NP_PageBreak - completely (re)done!

Post your new plugins here!
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts

Postby ftruscot » Mon Jul 28, 2008 8:21 pm

You don't need to translate these. They are just the default values when the option is created. They represent messages you want to show the user in different cases, you can make them what you want. No need for an actual translation. For instance, make this:

Code: Select all

$this->createOption('error','Error message when trying to access a non-existent page','text',"<h2 class='pagetitle'>Požadovaná stránka neexistuje.</h2>");
be this:

Code: Select all

$this->createOption('error','Error message when trying to access a non-existent page','text',"<h2 class='pagetitle'>Page does not exist.</h2>");
I'd see where each phrase shows up on the page and replace the czech with the english I would want there.

You cannot remove those vars because they are used in the class. They are class vars, so within the methods, they will be addressed like $this->pages. For instance at the top of the event_PreItem() method, you see all four being used:

Code: Select all

function event_PreItem(&$data) {
       // init vars
        $this->pagecount = 0;
      $this->pages = array();
      $this->pagetitle = array();
        // full page view - replace pagebreaks for H2 and exit
        if ($this->page == 0) {
           $data['item']->more = preg_replace('/<p>\%pagebreak\((.*?)\)\%<\/p>/i', '<h2>$1</h2>', $data['item']->more);
Posts: 89
Joined: Wed May 07, 2008 11:05 am

Postby PakTrik » Wed Oct 22, 2008 4:41 pm

Just applied "pagebreak" to a new blog and it works perfect. Just what I was looking for. Thanks to all nucleus dev's.

I'm just missing one minor feature: I would like to see the navigation list of an item also in my sidebar. The way it is designed now doesn't make this possible, but maybe it's only a small adjustement ....

Thanks anyhow
Posts: 4
Joined: Sat Aug 15, 2009 2:46 pm

trouble with navigation

Postby bratrekim » Sat Aug 15, 2009 3:02 pm


I would like just to ask if this plugin is fully compatible with newest version of Nucleus (3.41).

I tried to install it and it somehow works, but I somehow cannot force navigation to be shown.

I am only a beginner, so I wrote "<%PageBreak(links)%>" into "Item Pages" of default Skin. However, its not working. When I type for example http://localhost/nucleus/?itemid=2&page=2, it shows right page, but no navigation bar (no links to other pages).

Please, have a patience wih me and tell me how to fix it.

Posts: 21
Joined: Sat Apr 24, 2010 3:51 am

Postby Apocryphon » Mon Apr 26, 2010 4:56 am

Yeah, any examples for how to use this plugin would be greatly appreciated!
User avatar
Posts: 178
Joined: Wed Sep 23, 2009 5:16 pm
Location: Fremont, CA

I got it to work

Postby ltoozcms » Sun Jul 17, 2011 10:10 pm

I use pagebreak for my website, here is how I use it basically


User avatar
Nucleus Guru
Nucleus Guru
Posts: 872
Joined: Sun Aug 30, 2009 3:29 am
Location: Pembroke, NH

Postby WillyP » Mon Jul 18, 2011 5:11 pm

Thanks, Louis, for another fabulous tutorial!

BTW, I tried to comment on your site but kept getting an error: 'Wrong MD5 hash or expired key!'
Posts: 419
Joined: Tue Aug 03, 2004 2:36 pm
Location: Italy

Postby Hiro » Wed Jan 01, 2014 1:27 pm

I would suggest further improvements for this useful plugin.

1) in the admin pane, a checkbox or something else ("enable auto-pagebreak", or similar), and a formbox ("subdivide pages each X lines"); I guess that's intuitive.
So, if one wishes to automatically subdivide an article in several chunks, without inserting the pagebreak snippet each time in the place where it will be divided (the "classic system"), one haves only to check that option, and the action will be done automatically.
In the case that this code's integration may involve any problems with the core of the cms, let's do that the user must enter the pagebreak command only at beginning, or anywhere else, of the article, and the script will be invoked selectively for that article.
I think that this would be a better option, 'cause, if one day one deselects the checkbox, the automatical subdivision will vanish from the articles wherein it was included.
Second consideration: in the case one haves already several articles subdivided with the classic system, along with the enabling checkbox would be good to put also an "override current subdivisions" checkbox... ;-)

Obviously, the automated system puts some problems into what is the system of naming for each chunk (you knowk, the "chapters", as we named then): I think that this may be surpassed with making that the writer will put at the very beginning of each article a sequence of this kind:

<%1-name of the chapter|2-name of the chapter|and-so-on%>
this won't affect the article validity in the case that the auto system will be disabled; simply, that tag won't appear.

Obviously, this method will override the basilar system (which won't have any chapter naming; so, that would be good in the case one wishes only simply a subdivision of an article in smaller parts for easy reading), in the measure that the chunking will be done according to the combo "X lines"+"number of chapters".
If the number of chapters are less than the default number of lines, the latter will be subject to the former, as far as the article will be anyway cut in parts of X lines each, starting from the beginning, but if there will be some lines in exhuberation towards the number of chapters, then the last chapter will include the remainder lines along with the ones of the default number assigned to each chapter.
In the case that the number of chapters were more than the default chunking declararation, then the latter will be adjusted in a measure to accomodate a subdivision subordinated to the former.

2) I think that nucleus' owners should considere to embed definitively a button in the edit panel, which invokes the pagebreak command (mean, like there it is in wordpress, for example); besides being boring to write it down manually each time, I think that this command it's a must have for any serious editor.

Posts: 419
Joined: Tue Aug 03, 2004 2:36 pm
Location: Italy

Postby Hiro » Sun Jun 08, 2014 2:24 pm

Excuse me......... but............. now even pagebreak doesn't work anymore!!!!!!!!! And I'm still in the older version of nucleus! Every article featuing a pagebreak tag doesn't display any article's chunking! But the pagebreak tag is written into the article page! WTF!!!!!!!!!!!! Here nothing works anymore!

Return to “Plugin Development”