Conditional String Expression to hide Accordion Item

Hi. I’m struggling to work out the Conditional String Expression to hide an Accordion Item based if a post that has a certain category selected.

I have set up an Accordion that is showing posts based on years 2022, 2021 and so on. I want to set up Accordion Items for 2023, 2024, etc but have these Accordion Items hidden until there is a post that has 2023 selected as its category.

The Themeco docs conditions and assignments page shows an example where you can select Post Category as a condition, but I don’t have this option available to me. It may be unavailable because I’m pulling in my posts via a Global Block.

Any advice is gladly appreciated. Thank you.

Hello Paul,

You have use ACF dynamic content to display the content in the accordion item. You can also to use ACF dynamic code in your condition.

Best Regards.

Thanks for your reply @ruenel, but that’s not going to work for me.

I need to be able to hide/show the Accordion Item (and its Global block containing posts) based on the category assigned to the posts.

Hi Paul,

To Show/Hide the Accordion Item you need to assign the Condition as explained by my colleague. To check the assigned category, you need to add the condition accordingly.

Hope it helps.
Thanks

Hi. Again, thank you for your reply, but it hasn’t solved the issue.

Please re-read my initial post and note that the Accordion Item contains a Global Block containing Posts with a Looper Provider pulling in a Post (Residents) with a Taxonomy (2023).

What I need is a String Expression that notes if a post contains the ‘2023’ category and will then show the Accordion Item and its content.

Hello Paul,

Regretfully, what you have in mind is not possible because the Accordion Item is no way connected to the looper. It only display the global block and it is difficult to find out what is inside the global block.

Thank you for your understanding.

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