Setting Queries (Looper Provider) and conditions (Looper Consumer) as parameters for a component

Hi,
I would like to create a posts overview (looper) as a component, to which i can pass different queries and conditions as parameters, depending on what i want to display. I would then like to use these component, e.g. as a general overview of all contributions in just one category or as a contribution overview of only one author’s contributions, etc. I have read the doc on parameters, but I still don’t understand how I can do this:

For example, I want to pass such a query string to the looper provider of the component: “category_name={{dc:url:param key=“cat” fallback=”"}}&orderby={{dc:url:param key=“order” fallback=“date”}}&posts_per_page=-1"
And I want to pass different conditions to the looper consumer of the component, e.g. : “Post (has term) has Kat_1” or “Post (has term) has Kat_2” (or others)

How do I have to enter this under Edit Parameters and how do I then transfer these parameters to the component?

Have a look at what values are in the dev tools when using the query builder to get an idea on how you’ll map your parameters. It’s a mix of wordpress IDs and labels. Then try building it with the query string. Let us know if that clears things up!

Hi Charlie,
Thanks, that’s a valuable tip, I hadn’t noticed it yet, I’ll look into it further.

But I actually created the desired provider query string and the condition for the consumer correctly. Here my example:

Provider Query String: category_name={{dc:url:param key=“cat” fallback=”"}}&orderby=date
Consumer Condition: Post (has term) has Kat_1

I’ve also read https://theme.co/docs/parameters, but I still don’t understand how to pass these strings to a component with different elements (now. A concrete answer would be helpful for me here:

Where do I have to enter which JSON code?
Where in the elements of the component do I have to activate parameters or enter something?

I think it’s about a new theme feature, specific help at this point would certainly help many web designers like me - without having to hire developers.

Thanks for your support!

Ok, I’ve already gotten a little further on my own.
This tutorial helps: https://www.youtube.com/watch?v=Ke8AdlYaY7Y

I created a JSON code in the parameter editor (and learned I had to mask double quotes with leading backslash):

and wrote {{dc:p:query-string}} into the WP Query field of proviodr.
Query string paramater for provider is working now. Perfect!

Remaining question: Is there a tutorial / doc to learn which field types to use in which cases?

And: I want to pass the condition “Provider_Output is not empty” to the consumer as a parameter.
How do I write this in JSON Editor and in Consumer’s condition field?

Hello Daryl,

Please check out this documentation first:

As for the Conditions, you may have to add them to a container. You may not need to add it to your Component.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.