I’m having an issue that I’ve thrown a few hours into with no luck.
I’ve got a repeater inside a flexible content which is, in turn, inside a repeater, all in an options tab.
All is happy until I get to deepest level where the get_sub_field value is refusing the play along.
I know the if/while in the flex content is working because it will create a block for each element I’ve added, but the actual fields inside the repeater don’t seem to want to register. Have I hit a physical limit here, or is there something silly I’m doing?
<?php if(have_rows('partner_portal_tab','options')): while(have_rows('partner_portal_tab','options')): the_row(); ?> <div id="tab-<?php echo $i; ?>"> <?php if(have_rows('tab_content')): while(have_rows("tab_content")): the_row(); ?> <?php if(get_row_layout() == "text_content_block"): // layout: Text Content ?> <div class="userContent PPtextContentBlock"> <?php the_sub_field('text_content'); ?> </div> <?php elseif(get_row_layout() == "file_list_block"): // layout: File List Content ?> <?php if(have_rows('file_list')): while(have_rows('file_list')): the_row(); ?> <article class="faqList cf"> <dl class="faqQuestion"> <dt> <p class="questionInner"> <?php the_sub_field('file_list_title'); ?> </p> <span class="faqQuestonArrow"></span> </dt> <dd> <?php the_sub_field('file_list_content'); ?> </dd> <!--.faqQuestion--></dl> <!--.faqList--></article> <?php endwhile; endif; ?> <?php endif; ?> <?php endwhile; ?> <?php endif; ?> <!--#tab-<?php echo $i; ?>--></div> <?php $i++; endwhile; endif; ?>
Your code above should work, so perhaps you have hit a limit and the values simply arn’t being loaded.
Can you please debug the original repeater field like so:
echo '<pre>'; print_r( get_field('partner_portal_tab','options') ); echo '</pre>'; die;
Have a look at the data displayed. Is all the data correct?
I did some run through in the support section and we came to the conclusion that the ‘file_list’ array was showing the ‘file_list_title’ as being empty.
We came to the conclusion that this is in some way a limitation of memory or something. I tried increasing PHP settings to no avail, but just ended up rebuilding this to have two levels less repeaters and that seemed okay. Not sure exactly what limit was playing against me which is a bit frustrating.
Thanks for your help!
The topic ‘Nested Repeater, inside a flex content, inside a repeater.’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.