Set Terms parameter by dynamic content acf

The parent page(s) where template loop is embedded has an acf field where I’m setting the taxonomy names and want to filter the loop based on that field. This template will be used on several pages with different content/taxonomies chosen.
What I have now:

<Loop type=cpt_feature_requests taxonomy=request_board taxonomy_compare=and terms={Field connections}>

What is the right way of doing this?

Hey Alex, welcome to the forum! You’re right on track and it looks like you’re correctly using that taxonomy_compare parameter (assuming you only want to display posts that have all the taxonomy terms mentioned in the terms parameter). The only issue I’m seeing right away, which is actually visible just based on the code highlighting here in the forum, is that you’re missing some quotes like this: terms="{Field connections}". This works the same way as in HTML since the spaces will be understood as separating multiple attributes.

As noted here in the getting started guide, here’s how you pass a dynamic value to an attribute or parameter:

To do this, replace the angle brackets that would usually surround a dynamic tag with curly braces. Since these attributes usually contain a space, be sure to wrap them in quotes.

Let me know if you run into any other issues!

1 Like

Thanks Benjamin - that worked! So simple!
Love the plugin - it’s exactly what I’ve been looking for for years as it’s so builder-agnostic.

Awesome, glad to hear that’s working out for you!

Thanks for the kind words! That was the exact reason we built this plugin; we work on client sites that all use different builders and we needed a dynamic data tool that gave you all the same superpowers no matter what builder the site was using.

If you haven’t already, it would mean a lot if you’d be willing to share what you wrote in a review of the plugin on the repo. We’re trying to bump that star rating up closer to five stars and every review helps get the word out there and allows us to continue to provide high-quality support for this free plugin. If you’d rather not share a review, no worries :slight_smile: Best of luck with L&L!

1 Like