Home Forums Add-ons Flexible Content Field Flex Content in Repeater Reply To: Flex Content in Repeater

  • Hi @robertrhu

    I’m sorry I think I made a mistake in my last answer. If the add_resorts_hero_slider_video and the add_resorts_hero_slider_image fields are located inside the flexible content, you should be able to do it like this:

    <!--ORBIT SLIDE-->
        if (have_rows('add_resorts_hero_image_slide', 'option')) {
            while (have_rows('add_resorts_hero_image_slide', 'option')) {
                if (have_rows('choose_resorts_hero_slider_content')) {
                    while (have_rows('choose_resorts_hero_slider_content')) {
                        echo '<li class="orbit-slide">';
                        if( get_row_layout() == 'resorts_slider_video' ){
                            $herovideo = get_sub_field('add_resorts_hero_slider_video');
                            echo $herovideo;
                        } elseif( get_row_layout() == 'resorts_slider_video') {
                            $heroimage = get_sub_field('add_resorts_hero_slider_image');
                            echo '<img src="' . $heroimage['url'] . '" />';
                        echo '</li>';
    <!--END ORBIT SLIDE-->

    To learn how to use image field, please check this page:

    If that code doesn’t work, kindly share the JSON export file of your field group so I can test it on my installation.

    Thanks 🙂