Splitting concrete5 content into multiple pages

Sometimes you have a whole lot of content that you want to break into multiple pages, but you don't want to actually create those pages. For exactly that purpose I created the Page Splitter, a block to indicate the end of a page section and that can transform into a pagination.

It'd have been easy to just add some kind of tag into the content block, but I wanted to support other kind of blocks as well. With Page Splitter you can easily add a block *after* each section you want to paginate. With this approach it's possible to e.g. create a Content block and an Image block on page 1, and a Video block on page 2, for example.

At the time the add-on was reviewed in the PRB (Peer Review Board), it was suggested that it'd be great if multiple areas were supported. So I changed a few bits and now it supports multiple paginations on one page. I think that's one of the great things of PRB, it really affects the overall quality in a positive way.


Here's how the Page Splitter looks in edit mode:


And this is how it looks in normal mode:


Technical bits

When a page is viewed, the add-on keeps track of how many Page Splitter blocks are present in each area. When a block is about to be rendered, the add-on checks which 'page' the user requested for that area. If there are blocks after a certain Page Splitter (read: page), the add-on prevents rendering for those blocks. Rendering can be prevented with the on_block_before_render event event. The add-on can be disabled via a config setting on a dashboard page.

It's important to note that this add-on only works in concrete5 8.4.0 or higher. Also, if you use this block on a certain page, Full Page Caching needs to be disabled otherwise the user will always remain on the same page.

More about Page Splitter.