Output ACF Field Based on Another ACF Field’s Value
-
Greetings – We’re attempting to build a dynamic table using this plugin with ACF. Essentially this is a front-end for entering products onto a website and then displaying them in a table. It’s been a challenge and we’re looking for some help.
The code is below and the first table row works fine — it loads the column headers the user selected from an ACF form from a list of 12 or so.
The next section of code needs to pull in the field data from the above column headers for whichever products the user chose to be included in the table.
So, they choose the table’s column headings (which have values of things like size, color, etc.), and then they choose the products to show in the same table via an ACF Post Object field.
We can’t figure out how to replace [field part_number] in the code below with a dynamic loop that will show the appropriate data based on the columns the user selected in the first repeater (e.g., size, color, etc.).
Hope that makes sense!
———————————————
[repeater product_table]
<h2>[field product_table_title]</h2>
<table style=”width:100%”>
<tr>
[-repeater product_table_columns]
<th>[field product_table_column]</th>
[/-repeater]
</tr>[-repeater product_table_products]
[related product_table_product]
<tr>
<td>[field part_number]</td>
</tr>
[/related]
[/-repeater]</table>
[/repeater]
- The topic ‘Output ACF Field Based on Another ACF Field’s Value’ is closed to new replies.