Component that I can change the looper tag

I have a template done that I only want to change the looper provider taxonomy. How do I create a parameter to map to the full looper is query builder gallery, then select the taxonomy? Basically, it shows all the posts of galleries with a taxonomy that the end user selects.

The documentation says to use dynamic content, but I don’t specifically understand how that works when referencing existing content eg get content galleries and filter by taxonomy. ideally I’m looking to create a dropdown list of taxonomies and the end user selects the taxonomy and that is it. I can not find a reference to post types and taxonomies for parameters

so I am thinking to do this i change the looper to a query string then something like post_type=gallery&posts_per_page=-1&post_status=publish&tax_query[0][taxonomy]=client&tax_query[0][field]=slug&tax_query[0][terms]={{dc:p:customer}}

but I have not been able to get anything to show on the preview using the query string so I am not sure that it will work or if this is the right direction. Do query string entries show in the preview?

im assuming anything that can be made on the querybuilder should be able to be replicated with a querystring is there a way to look at the output of the query builder to add this as a querystring because posttype=gallery is not pulling the gallery data like the query builder does selecting post type gallery

Hello @wicara,

Thanks for writing in!

Please post a screenshot of your Looper Provider Query Builder so that we can replicate it with a WP Argument to be able to come up with the query string.

Thanks.

I have gone through and made it work by checking the query with query monitor if anyone else is having the same problem the envira page type is envira not gallery

post_type=envira&posts_per_page=-1&post_status=publish&tax_query[0][taxonomy]=client&tax_query[0][field]=slug&tax_query[0][terms]={{dc:p:customer}}&orderby=date&order=DESC

also I have created a parameter that works in a component but it doesnt work when I enter it into a single layout Is there an additional step to add a paremeter to a single layout ?

Hi @wicara,

The query does not give any clear idea of what exact problem you are having. I would request that you please provide login credentials for your site in a secure note to examine it further, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password
– Specific page and section where you have added this query.

To create a secure note, click the key icon underneath any of your posts.

Thanks

so I am adding the component into the single layout and I am wanting to use the component as a component ie enter the customer and description. When I add the component to the single layout it becomes uneditable my parameters dont come up.

I tried recreating the component in the single layout with paremeters but it doesnt work either.

Hello @wicara,

Your query argument should be this:

$args = array(
 'post_type' => 'envira',
 'posts_per_page' => -1,
 'post_status' => 'publish',
 'orderby' => 'date',
 'order' => 'DESC',
 'tax_query' => array(
   array(
     'taxonomy' => 'client',
     'field'    => 'slug',
     'terms'    => 'Jetts',
   ),
 ),
);

which will give you this query string:
post_type=envira&posts_per_page=-1&post_status=publish&orderby=date&order=DESC&tax_query%5B0%5D%5Btaxonomy%5D=client&tax_query%5B0%5D%5Bfield%5D=slug&tax_query%5B0%5D%5Bterms%5D={{dc:p:customer}}

Hope this makes sense.

This is a differnt query that works but in particular I was looking to add a component into a single page template and be able to change the parameters for the end user.

here is what I have tried:

added the component into the single page template then saved, this only shows the parameters that I enter into the template.
added the parameters and elements into the template and the parameters don’t update the content

Hello @wicara,

Can you please share to us which single page template you were adding the component so that we can check it?

Thank you in advance.

added in secure note
image
this component is added to the single page template and the goal is to have the end user open a portfolio enter two parameters and done

Hello @wicara,

Please see the secure note.

Thanks.

I want to be able to dynamically set the content for the component in the single-page layout by allowing the end user to select which content to show in the portfolio. The component allows the single pay layout designer to change the component for all portfolios but it doesn’t allow the end user the ability to enter into the parameters.
In your example in the secure note that would be correct.

Hey @wicara,

I am curious how the end user will change the parameter. Will there be a dropdown selector or something?

Thanks.

I ended up creating a select field and connected it to a custom taxonomy. if the portfolio was the taxonomy it getts all the galleries that are the same taxonomy. The Key was that I had to add the looper provider and consumer in the component.
I have it working a treat now

Hi @wicara,

Glad to know that it is working now.

Thanks

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