Support

Account

Home Forums Add-ons Flexible Content Field Toggle Display of Row Content on Page Reply To: Toggle Display of Row Content on Page

  • Thanks so much @hube2 that did the trick.

    Here’s what the final code ended up looking like:

                <?php if (have_rows('folio_items')) {
                    while( have_rows('folio_items')) {
                        the_row();
                        if (get_sub_field('toggle_display')) { ?>
    
                            <!-- FOLIO ITEM FLEXIBLE CONTENT -->
    
                            <div class="col-md-3 col-sm-4 col-xs-6">
                                <a class="overlay" data-toggle="modal" data-target="#<?php the_sub_field('project_id'); ?>"><i class="fa fa-search-plus"></i><h3><?php the_sub_field('project_title'); ?></h3></a>
                                <img class="img-responsive" src="<?php the_sub_field('project_thumbnail'); ?>" alt="<?php the_sub_field('project_title'); ?> Thumbnail">
                            </div>
                            <div class="modal fade" id="<?php the_sub_field('project_id'); ?>" tabindex="-1" role="dialog">
                                <div class="modal-dialog modal-lg">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                            <h4 class="modal-title"><?php the_sub_field('project_title'); ?></h4>
                                        </div>
                                        <div class="modal-body">
                                            <div class="row">
                                                <div class="col-md-9 col-sm-8">
                                                    <?php the_sub_field('project_content'); ?>
                                                </div>
                                                <div class="col-md-3 col-sm-4">
                                                    <h5>Client</h5>
                                                    <p><?php the_sub_field('client_name'); ?></p>
                                                    <hr>
                                                    <h5>Details</h5>
                                                    <?php the_sub_field('project_details'); ?>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="modal-footer">
                                            <a href="#" data-dismiss="modal">Close Window <i class="fa fa-times"></i></a>
                                        </div>
                                    </div><!-- /.modal-content -->
                                </div><!-- /.modal-dialog -->
                            </div><!-- /.modal -->
    
                        <?php } ?>
                    <?php } ?>
                <?php } ?>