📜 ⬆️ ⬇️

PageBreaker extension for MODX - pagination of texts

I present to you a new ready-made extension for MODX Revolution - PageBreaker.

It consists of two plug-ins for MODX + a highly modified bagebreak plug-in for TinyMCE.

The principle of operation is not complicated: the PageBreaker plugin looks into the content of the loaded page to find a special <! - pagebreak -> tag there and, if found, breaks the page into pieces, generating links to the following.
The second plug-in PageRedirector reacts to help the first by redirecting requests from text pages to the document containing them.
')
Basically, these two plugins are enough. If you do not use editors and format manually, you just need to add <! - pagebreak -> to the text and everything will be ok.

However, if without TinyMCE you cannot imagine working with the site, you need to make some settings:
Go to the System -> System Settings -> select the tinymce section and enter in:
• Custom Buttons Row 3 buttons pagebreak, pagebreakmanual, pagebreakauto, pagebreakcls
• Custom Plugins add pagebreak to the end.

After that, you will have 4 buttons in the third row of the editor. What for?
• Standart - puts in place of the cursor.
• Manual - say how many characters to put a break in the text and go!
• Auto - the same as in the previous paragraph, but the number of characters is set to 2500
• Clear - remove all empty paragraphs and page breaks.

That's basically it.

There is also an opportunity to load pieces of text not by clicking on links, but via ajax. This is a bit confused (you need to make a container for the text and put it in one chunk) - so it is disabled by default. Who cares - see FAQ.

Updated January 20, 2014
The component was completely rewritten, all the flaws of the old version were fixed. Details

Source: https://habr.com/ru/post/123033/


All Articles