Condition on Headline to display based on Custom Post Type Taxonomy

I have a Custom Post Type, Episodes, and the Archive slug is /episodes. I have custom taxonomy on the post type: Authors, Books, and Genres, which have slugs /book-author, /book, /book-genre.

They all use the same Archive Layout. I have three headlines on that layout. The first is “Episodes”. Underneath that one is a second heading Featuring "{{dc:query:search_query}}", and has Conditions Search is being viewed. The third and final headline is Featuring "{{dc:term:name}}", and I am trying to set a condition that says, when one of the three slugs for the taxonomy is used (/book-author, /book, /book-genre), display this headline, hide for /episodes.

The search condition is working as expected and great. It is the taxonomy one I am stumped on. The conditions in the screen shot make the most sense to my vernacular, but they do not work. I have tried countless others with no success.


Screenshot 2023-09-18 at 5.16.18 PM

What am I missing? Thanks!

Hi @franklinmarketing,

Thanks for reaching out.
You can use the {{dc:url:segment}} to get the value from URL and use {{dc:url:segment index=“1”}} for first and also change the index value to get other parameters.

Hope it helps.
Thanks

I am not sure I am tracking. I used this condition string, but no result.

Hi @franklinmarketing,

I have checked but didn’t find the Episode Archive* layout, but there is a Single Layout named Episode.

image - 2023-09-20T181702.564

If you are trying to point out that one, I would suggest you create a new Archive Layout instead of a single layout and try the same as shown in my first reply.

Hope it helps.
Thanks

It is the one called Primary Archive in the screenshot. Apologies for that confusion, we were working on it yesterday.

Hi @franklinmarketing,

You need to mention the specific taxonomy as shown in the given screenshot.

Hope it helps.
Thanks

Wait. lol. Seriously? Could you please actually look at the layout and the design to understand my question, because your suggestion here is almost comical. There are hundreds, and soon thousands of those and that is what I want the headline to show. So, using one archive, if a user searches, the headline says, Episodes featuring “searched phrase”. And, that works right now. The problem I am having is when a user uses one of the taxonomy links, for example this page /all-genres, and clicks one. I want the headline to now say, Episodes featuring “that clicked term”. If you look at the page and load it on the front end it should make clear sense.

Hello @franklinmarketing,

Thanks for the clarifications. At the moment, we only have these Global Query conditions:

There is no element condition to check if it is a tag or category archive. If I am gonna do what you have in mind, I would duplicate your Primary Archive layout and create a new one for the Taxonomy Archive layout so that I can easily have “Episodes featuring “taxonomy name”” headline.

Best Regards.

do you use a filter plugin or something like that?
what you try to archvie should be possible with strings? did you allready try strings?
cheers

Hi @deranaloge,

We don’t use any filter plugin. The {{dc:url:segment}} can be used here, which will return the first parameter from the URL i.e. book-genre and can be checked in the condition. So, no need to check individual taxonomy name.

Thanks

@tristup - thank you for leaving that trail in the text element! I understand what you’re saying now. Your first suggestion did not make sense to me because your screen shot had the term itself. Your text field with {{dc:url:segment}} helped me get it. Thanks for the assist! Working as intended now.Screenshot 2023-09-25 at 1.52.07 PM

Thanks for this reply, as well, @ruenel. I did think of this and it does accomplish what my intent was. But, I wanted to avoid another layout for ease of management. I realize I could have used some global components, but the {{dc:url:segment}} trick was a nifty way to accomplish it. It got me thinking, do y’all have a resource that lists out all these dc strings/details? It would be a big help to users like me (who have been with y’all for some time now).

Hey @franklinmarketing,

There is when you click the Dynamic Content icon. You can learn more about the Dynamic Content here: https://theme.co/docs/dynamic-content

image

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