Home Forums Add-ons Flexible Content Field Pagination Reply To: Pagination

  • I think I’m trying to accomplish the exact same thing as @pixaro, but I’ve been spinning my wheels for hours and getting nowhere.

    To be clear, I’m trying to split each flexible content section into its own page, as if I were using <!--nextpage--> in the content.

    Here’s a screenshot of my relevant layouts. You can see I’m attempting to use a layout called “Page Break” containing a true/false field called “Break Here” to create the breaks.

    Here’s the simple, working loop I’m using to get the “Section Title” and “Section Text” into the page.

    <?php while(has_sub_field("content")): ?>
      <?php if(get_row_layout() == "section_content"):  ?>
        <h2><?php the_sub_field("section_title"); ?></h2>
        <?php the_sub_field("section_text"); ?>
      <?php endif; ?>
    <?php endwhile; ?>

    Beyond this, I’m lost. I’ve tried a number of things, including creating a counter using this information, but I could never get it to work.

    Could anyone possibly share a more complete solution?