I’ve got an ACF repeater that takes a page object, and a number of other values.
For each value, I want to check if it has a value or if it’s empty, then:
- if it has a value, show the value of the dynamic field.
- if it doesn’t have a value, use a value from the set page object.
Right now, I’m solving this by having a “parent” query for the repeater. Inside this are duplicate bricks elements with conditions - one checks if the parent page’s value is set, in which case it shows that. The other is a block with a condition that checks if the parent page’s value is empty. If so, the block is also a query loop that references the page object, and gets the value from that.
However, this means that:
A) I need to have a query for every field I want to show, which is inelegant and
B) I can’t turn the entire outer block into a {post link} to the page because then I won’t be able to get the repeater values, only the page object values.
Is there a way to create this using only two queries (one on the repeater, one on each page object) by referencing the values from the repeater inside the query of the page object?
Here’s how it looks now: