Support

Account

Home Forums Add-ons Repeater Field Filter or Group Value from ACF Repeater Field

Unread

Filter or Group Value from ACF Repeater Field

  • I’m looking for a shortcode or some assistance to group the “property_type” column to display the same as shown in FIGURE 2 (on front end).

    The data in Figure 1 is populated using ACF repeater field. I used a plugin from Hookturn called ACF Custom Tables to put the data in its own table (because I needed an easy way to download and upload thousands of entries). Nested repeaters were not an option. Now I have run into a problem rendering the data on the front end.

    Figures 1 and 2

    My attempt at grouping the property_type column – please excuse my php skills!

    if(get_field('properties_tbl')): ?>
    <?php while(has_sub_field('properties_tbl')): ?>
        <table class="prop-table">
    		<tr><th style="text-align:left"><strong><?php the_sub_field('property_type'); ?></strong></th>
             <th style="text-align:center"><strong>Unit</strong></th>
             <th style="text-align:center"><strong>Test Procedure</strong></th>
             <th style="text-align:center"><strong>English</strong></th>
      <th style="text-align:center"><strong>    -    </strong></th>
                            <th style="text-align:center"><strong>SI</strong></th></tr>
    </tr><?php endwhile; ?>
    <?php while(has_sub_field('properties_tbl')): ?>
    <tr><td style="width:35%"><?php the_sub_field('property_name'); ?></td>
     <td style="width:15%;text-align:center"><?php the_sub_field('test_method'); ?></td>
     <td style="width:25%;text-align:center"><?php the_sub_field('unit'); ?><?php the_sub_field('note'); ?></td>
     <td style="width:10%;text-align:center"><?php the_sub_field('english_num'); ?><?php the_sub_field('english_txt'); ?></td>
     <td style="width:5%;text-align:center"><?php the_sub_field('_'); ?></td>
     <td style="width:10%;text-align:center"><?php the_sub_field('si_num'); ?><?php the_sub_field('si_text'); ?></td>
    </tr>
    <?php endwhile; ?><?php endif; ?> 
    </tbody>
    </table>
    

    Result:

    result

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.