Plugin to layout the content of a big page into several subpages.
Concept of operation
Plugin seeks for definite delimiters in content of the page, on default
<!-- pagebreak -->. If it finds any, it divides the page according to them and generate link for the next ones.
When you click on such link MODX does not find a necessary page because it does not exist, it generates event OnPageNotFound. Plugin responses to this event, finds required piece of content and outputs it.
Thus several "virtual" pages are resulted from one real page.
Plugin activity can be seen on demo-site.
- Operates with cached resources.
- Loads only when there r delimiters in content.
- Delivered with plugin PageBreak and TinyMCE (TypoMCE) to do automatic layout split of the text.
- Supports friendly urls
- Supports common documents and containers
Following chunks are used to format page-navigation:
|tpl.PageBreaker.begin||Reference to the first page||
|tpl.PageBreaker.next||Reference to the next page, it can be empty.||
|tpl.PageBreaker.prev||Reference to the previous page, it can be empty.||
|tpl.PageBreaker.outer||Block with all references.||
If you are on the first or last page, references to the next or previous pages will not be generated. This is done so that you can check such situations with output filters and substitute a reference to the beginning of the document. It was done this way with standard chunk outer:
<div class="pagebreaker"> [[+pb_link_prev]] <span class="pb_page_current">[[+pb_page]]</span> [[%pb_page_from]] <span class="pb_page_total">[[+pb_total]]</span> [[+pb_link_next:default=`[[+pb_link_begin]]`]] </div>
Plugin can operate in Ajax regime, it means to switch pages without restart.
- For this you need to activate system setting pagebreaker_ajax
- References to pages should have class
pb_link. Check it if you changed standard chunks.
[[*content]]should be wrapped in element with #pagebreaker_content (pagebreaker_ajax_selector can be changed in the settings).
<div id="pagebreaker_content"> [[*content]] </div>
If page user has an old browser – hash should be enabled in url