Although EE is a brilliant CMS I have found it’s pagination support a little lacking, even compared to something as basic as Wordpress. Fortunately the plugin system provides a decent opportunity to make up for any shortfalls and hopefully ‘Simple Pagination’ does just that.
Additional details can be found on my blog but basically this plugin makes it possible to split up entries into an unlimited number of pages by adding a {pagebreak} tag to a message.
Fairly detailed usage info is available in the usage section after you install the plugin and the features are very similar to the standard EE ones so the manual page is probably fairly useful too.
I can not tell you how nice it will be to have this to point to, it is a fairly oft-requested feature. I hope you’ll submit it to our plugins site as well!
And the main point of this message - thank you. =)
One thing that I’ve just realised I have forgotten to mention is the optimum placement of any {pagebreak} tags. This only really matters if you’re using the XHTML formatting option but what you want to do is have two linebreaks before and after as if this will ensure that the final <p> tag is closed at the end of the page and likewise that if the next page starts with text then it also begins with a fresh <p> tag.
... end of one page here.
{pagebreak}
Another page gets started here.
This is required as EE adds any automatic formatting before sending the data to the plugin and as {pagebreak} acts as a divider between pages absolutely anything to the left of the tag will go one page one and anything to the right will be on page two. So if you used the following:
No as {exp:pagination} goes in your template, not your entry. You then place your field name inside the {exp:pagination} tags and that ensures the field data is processed accordingly.
Hopefully that makes sense, but basically no, all that’s required is the plugin itself.
end of my paragraph.{pagebreak} New paragraph here.
? In template?
What determines where the page break then? Paragraphs or? Sorry if I’m being dense, just woke up
(thats my excuse and I’m stickin to it) lol
ok, with some coffee it all came together.
(Note: add to docs, “have 2 coffee, then read instructions”)
Well done!
{pagebreak} tags split up the pages, but you don’t need the EE tags plugin. Call it black magic if you like.
All the info you need to use the plugin is available in your control panel’s plugin manager after installing it. If after having a look at that you’re still unsure then just let me know.
Dom.S:
From your comment above, were you saying it doesn’t close open tags? Anyway to modify the plugin to close open tags on the ends of pages and create any beginning tags for those with only closing tags?
I’m just thinking of this from the perspective of me creating a site for an end user. So while we all may be alert enough to make sure all tags are closed before we insert the {pagebreak}, some end users are not that knowledgeable. Having unclosed/unopened tags would certainly cause some issues with page display.
correct. i am aware that the {page_break} itself isn’t a tag. I’m talking about when there are tags within the body (which is what he was saying as well). So if you put a {page_break} in the middle of a bolded section. There will be no </strong> on the first page and only a </strong> on the next page. That could be a problem.
And while it is easy to say “make sure all of your tags are closed”. An end user who has no idea about html won’t have a clue what that means…and will more than likely not do it correctly.
Oh yes, I see what you are saying now. That could become a problem, indeed. Perhaps some php string function involved in the module could scan for open/closing tag pairs?
Or simply insert line breaks in the page, before and after the {page_break} tag?
This may not be as bad as it seems (from above):
This only really matters if you’re using the XHTML formatting option but what you want to do is have two linebreaks before and after as if this will ensure that the final <p> tag is closed at the end of the page and likewise that if the next page starts with text then it also begins with a fresh <p> tag.
It doesn’t seem to apply to other tags, just the EE generated paragraph tags added in XHTML formatting.
I cannot get simple_pagination to diplay a custom fields after the final page only.
I have a large article with need to publish references after the last page of the main article - Customer wants references to have its own custom field