<?php
if(have_rows('flexible_layout') && get_field('active_flex_nav', 'option') == 'true'):
  echo '<ul class="side-nav" id="flex-nav">';
    while ( have_rows('flexible_layout') ) : the_row();
    echo '<li class="nav-item" data-href="flex-section-'.get_row_index().'">';
      echo '<a class="smooth-scroll" href="#flex-section-'.get_row_index().'"></a>';
    echo '</li>';
    endwhile;
  echo '</ul>';
endif;
