I am searching for a solution, where different terminals see different content. I am thinking about using categories for the terminals and additionally tags for sorting the content. No idea, if this will ever become a working solution.
first step should be permanent sending the terminal name as category from the corresponding terminal. I believe I could do this via function.php (http://âŚ/?category=terminal01)
second: I need to sort the content via looper. But unfortunately the looper did not know, which terminal is asking for content. I should be able to extract the category name from the dynamic url (e.g. http://mydomain.com/news?category=terminal01) and use it in the WP query of the looper provider.
Possible and ny ideas how to do so?
You can always create a custom archive layout that will display the post items related to the category or tag. Regretfully there is no feature in the theme that allows you to create a sort filter button within the archive page. What you are trying to do may only be possible with custom development which is far beyond the scope of our support already.
What I need is to dynamically send the name of the category âmycategoryâ and use this in the looper.
Is there a hook to send the looper a value outside the original drop down?
If so, I could script a few lines, which will send the values for the category to the looper.
Iâm sorry but Iâm not entirely sure what you wish to achieve. As far as I understand, you want to display products based on category and tag. You can display products in a custom archive using the Query Builder Looper Provider. You can use Product Categories and Product Tags in there.
I want to go further.
What you are showing is the normal behavior of loopers.
Now think about this:
Looper Provider Query Builder is not using internal taxonomes.
I want to overhand variables from a dynamic url.
E.G.: Mysite.com/products?product=Hoodies
Looper will not use a fixed taxonomy, instead it will use the dynamic value. This is of course a tag or category. However, it is not fixed named in the Looper like âHoodiesâ. Looper is âlisteningâ if there is a parameter in the url.
Howdy, @mickna! Thanks for writing inâŚwhat you are attempting to do is not currently possible in the Query Builder as we donât support Dynamic Content in those parameters. This is a very advanced implementation you are trying to get setup, and as such falls more into a custom development camp that you will need to work on getting wired up. That being said, Iâd like to provide you with some assets that may help point you in the right direction.
Firstly, while you canât do this directly in the Query Builder, you should be able to achieve something via the Query String provider type, as this gives you full access to the WP_Query class, you just have to set everything up yourself. It seems like you are already fairly well versed in what youâre looking to accomplish, but if you have not reviewed the WP_Query documentation in a while, please do so here:
Next, coding a query string by hand is quite cumbersome, so youâll need a method for generating one based out of the information youâre trying to pass in. I explored this a while back with another customer and informed them on the specific steps I used to craft a query string they needed with the following resource. Please review this to see how those can be generated:
You will need to read through the WP_Query documentation to find the parameters you need to get your setup working, but once you craft your information using the steps outlined there and pass it into http_build_query(), you should get a working query string.
Now the one nuance here is that youâre also trying to create WP_Query string that references a literal query string in your URL. To do that, you will need the {{dc:url:param}} Dynamic Content string, which you can then pass a key into with the parameter youâre trying to reference in the URL. So, for example, if I wanted to access a query string called âbananaâ in my URL, you would use {{dc:url:param key="banana"}}. Then whatever that value is in the URL bar, you will be able to access it like so:
Now to actually reference a Dynamic Content string within your WP_Query string, there is a little bit of a nuance to get that working, but I actually explored that with another user here:
If you read through my comments there, youâll see how I included the Dynamic Content string in the query and had to do a little bit of manual formatting after running it through http_build_query() to get it working.
All of that should get you pointed in the right direction to get something like this working. As mentioned above, this is a highly custom implementation, which will need to be wired up on your end as itâs very unique to your setup, but it should be possible via the Query String Provider Type.