Hi, I posted this in the fb group and got an answer, but I was hoping to learn a bit more if possible.
Goal: If a True/False custom field on a repeater query loop is set to False / 0, then don’t show that div.
One Solution: Add an .inner-div inside of the query loop item, and add the condition on that .inner-div.
Issue: That still leaves an empty div on the page
Let’s say we have a CPT with 2 nested repeaters:
- Custom Post
-
- Section
-
-
- Item
-
We output the query loop:
- Container (querying the Custom Post) .cpt-container
-
- Nested query for the Section .cpt__section
-
-
- Nested query for the item .cpt__item
-
The item has a custom field “display”, and is a True / False toggle. In the database it’s stored as 1 or 0, a string, not an integer.
The output if you use the text element on the builder page is:
{acf_item_display} as either True or False
{acf_item_display:value} as either 1 or [blank]
Without custom coding, is there a way to set the condition inside of the Builder UI, on .cpt__item (the query loop itself), so that if display == false or 0, then the individual div does not show up on the page/source.