We are hitting up against some seeming limitations in the Query and Repeater blocks and want to check the best way to proceed.
One representative example of what we are implementing is a pricing plan grid. This has 3 pricing plans with a toggle for subscription terms and a toggle for currency.
Because we only want the client to have to edit the content of each of the 3 plans once, we created two custom types, a Pricing Plan (containing the price variations and subscription term taxonomy) and a Pricing Plan Detail (containing the various features and benefits).
The idea is to either link the Pricing Plan Detail to the Pricing Plan using a relationship field OR for both the Pricing Plan (variation) and Pricing Plan Detail to both have a related taxonomy that can be used in a sub query.
We have made several attempts to achieve this using various methods and in each case we were blocked by not being able to reference dynamic content (it appears).
The first limitation is, there is no Repeater source in the dynamic selection for taxonomy queries, only WordPress and ACF:
We thought perhaps we could access the repeater via the ACF Field group indirectly but there seems to be no way to get to the fields within each repeater instance that way:
We also thought perhaps there might be a way to reference the fields dynamically using a dynamic inserter or {acffield=fieldname}
syntax but that also doesn’t appear to be supported.
As we understand it, nested Queries are not yet supported with frontend rendering, but appear to work without it. We also see that nested repeaters appear to be supported.
We are able to use unrelated nested Queries/Repeaters without issue, we really just need some pointers on the correct way to reference fields and taxonomies in the scope of the parent Query/Repeater from nested blocks.
The open questions we have are:
- What is the correct way to reference ACF fields from a Query/Repeater in a nested Query/Repeater?
- What is the correct way to do a nested taxonomy query using a term or terms stored in the field of a parent Query/Repeater?
- What is the correct way to access the fields of a nested post object stored in a relationship field within a Query?
@Louis, your input will be greatly appreciated. If there is documentation or existing video tutorials that cover this, please just point us in the right direction.
Thank you.