ganeshXL
Testers

Posts: 1,277
|
 |
« Reply #15 on: Apr 07, 2007, 03:43 AM » |
|
This doesn't work at all here (modx 0.9.5). I don't cache my pages, there is no extra <?php stuff there, I even tried using my own delimiter |PAGEBREAK| but to no avail. No error messages, nada... My delimiters appear as normal text. Weird... o_O
|
|
|
|
|
Logged
|
|
|
|
|
betoranaldi
|
 |
« Reply #16 on: Apr 09, 2007, 12:00 PM » |
|
could it possibly have to do with the delimiter you are using?
I am using {BREAK} and it is working beautify in 0.9.5
|
|
|
|
|
Logged
|
|
|
|
sirlancelot
Coding Team

Posts: 572
Eats PHP for breakfast.
|
 |
« Reply #17 on: Apr 10, 2007, 05:21 PM » |
|
This doesn't work at all here (modx 0.9.5). I don't cache my pages, there is no extra <?php stuff there, I even tried using my own delimiter |PAGEBREAK| but to no avail. No error messages, nada... My delimiters appear as normal text. Weird... o_O
Make sure the correct "System Event" is checked, "OnLoadWebDocument" I believe is what needs to be checked in the plugin.
|
|
|
|
|
Logged
|
|
|
|
ganeshXL
Testers

Posts: 1,277
|
 |
« Reply #18 on: Apr 11, 2007, 03:06 PM » |
|
Nope, I DID check the event. And the delimiter doesn't really matter... I used the default one, and a custom string. I added a line to the module for debugging: echo "<script>alert('pagination module is processed!')</script>"; This is never being called. And the delimiters are still visible as regular text 
|
|
|
|
|
Logged
|
|
|
|
|
betoranaldi
|
 |
« Reply #19 on: Apr 30, 2007, 06:16 PM » |
|
Alright so I have come across a new issue with this plugin. Or it isn't really the plugin so to speak. I am using this to split up long stories on my site. the question is this...
I want to be able to pring the entire story, not just the page. Is there anyway to supply the enire document so that it can be printed?
Thanks Brian
::edit::
I think I found a solution... now I just need to impliment it... I'm not very good at php but I am going to give it a shot. My thought is this, instead of the plugin "discarding" the other pages, I want all pages to output but the pages that should be be visible should be wrapped around a div with a class of "pagehide" this way I can set the print style sheet to unhide these "pages" when printing.
|
|
|
|
« Last Edit: May 01, 2007, 08:13 AM by betoranaldi »
|
Logged
|
|
|
|
|
betoranaldi
|
 |
« Reply #20 on: May 01, 2007, 09:25 AM » |
|
I was able to get this plugin to do what I wanted.
I will classify this as a beta since I am not an expert php coder. It appears to be working properly for me.
any questions or comments would be greatly apprecited.
Thanks Brian
|
|
|
|
Logged
|
|
|
|
nlcluigi
Jr. Member

Posts: 22
cristiannica.com
|
 |
« Reply #21 on: Jun 27, 2007, 03:58 AM » |
|
The 2nd version - with pagination do nothing for me: it put page 1/2/3 for example, but I see the whole content on every page. I'm missing something?
|
|
|
|
|
Logged
|
|
|
|
|
betoranaldi
|
 |
« Reply #22 on: Jun 27, 2007, 06:48 AM » |
|
The 2nd version - with pagination do nothing for me: it put page 1/2/3 for example, but I see the whole content on every page. I'm missing something?
If you are talking about the version I created then you will need to create a style in your css: .hidepage {display:none;} the purpose of this is to hide the "other pages" when viewing it on screen but it allows you to create a print style sheet and in this style sheet you can set the hidden fields to be visible. therefore the entire story or article will print but only one page will be visible on screen.
|
|
|
|
|
Logged
|
|
|
|
zee
Jr. Member

Posts: 27
|
 |
« Reply #23 on: Oct 24, 2007, 07:17 PM » |
|
is it possible to give titles for pagination links or are there any addons for that function like joomla's pagebreak bot. for ex. {BREAK=Overview} {BREAK=Specifications} {BREAK=Conclusion}
And the link are overview, specifications and conclusions instead of next page or page numbers.
|
|
|
|
|
Logged
|
|
|
|
ZAP
Testers

Posts: 1,309
|
 |
« Reply #24 on: Nov 01, 2007, 04:28 PM » |
|
Just thought I'd post a slightly different version of this resource in case anyone else finds it useful. I use it as a snippet instead of a plugin (since I only needed to paginate a few documents). Place the snippet call in place of [*content*] in your template to use it this way. I also added links to each individual page instead of just Previous and Next. Very minor changes, but maybe someone will use them... <?php $delimiter = '{BREAK}'; $tplLinkNext = ' <a href="[+link+]">Next</a>'; $tplLinkPrev = '<a href="[+link+]">Previous</a> '; $tplLinkNav = ' <div style="margin:10px auto;width:100%;text-align:center;"><p>Page [+current+] of [+total+]<br /> [+linkprev+] [+pagelinks+] [+linknext+]</p></div> ';
$pip_content = $modx->documentObject['content']; $pip_pagecontent = explode($delimiter,$pip_content); $pip_pagecount = count($pip_pagecontent);
if ($pip_pagecount > 1){
$pip_currentpage = isset($_GET["page"]) ? $_GET["page"]: 1; if ($pip_currentpage > $pip_pagecount || $pip_currentpage < 1) { $pip_currentpage = 1; }
$char = ($modx->config['friendly_urls'] == 0) ? "&" : "?"; $url = $modx->makeurl($modx->documentObject["id"],'',$char.'page=');
$prevpage = $pip_currentpage-1; $nextpage = $pip_currentpage+1;
$linkprev = ($prevpage>0) ? str_replace("[+link+]",$url.$prevpage,$tplLinkPrev) : ''; $linknext = ($nextpage>$pip_pagecount) ? '' : str_replace("[+link+]",$url.$nextpage,$tplLinkNext);
$pagelinks=''; for($i=1;$i<=$pip_pagecount;$i++){ if($i==$pip_currentpage) $pagelinks.=' [ '.$i.' ] '; else $pagelinks.=' <a href="'.$url.$i.'">'.$i.'</a> '; }
$pip_template = str_replace("[+linkprev+]",$linkprev,$tplLinkNav); $pip_template = str_replace("[+linknext+]",$linknext,$pip_template); $pip_template = str_replace("[+total+]",$pip_pagecount,$pip_template); $pip_template = str_replace("[+current+]",$pip_currentpage,$pip_template); $pip_template = str_replace("[+pagelinks+]",$pagelinks,$pip_template);
$pip_content=$pip_template.$pip_pagecontent[$pip_currentpage-1].$pip_template; }
return $pip_content; ?>
|
|
|
|
|
Logged
|
|
|
|
|
thehen
|
 |
« Reply #25 on: Nov 28, 2007, 04:42 AM » |
|
Sorry to revive this thread, but I have a quick question. On a lot of sites tha pagination navigation appears at both the top and bottom of the page. Is it possible to create multiple instances of the pagination navigation, or how would I go about modifying it so I would be able to? Thanks 
|
|
|
|
|
Logged
|
|
|
|
ZAP
Testers

Posts: 1,309
|
 |
« Reply #26 on: Nov 28, 2007, 10:13 AM » |
|
You could just add the navigation snippet twice on the page (and if the snippet calls and page are cached, the code will only be executed the first time the page is loaded anyway). Or you could set a MODx plugin at the end of the snippet and use it as many times as you like on the page. You'd do that with something like:
$modx->setPlaceholder('page_navigation',$pip_content);
and then you can just place the placeholder [+page_navigation+] wherever you like.
|
|
|
|
|
Logged
|
|
|
|
|
betoranaldi
|
 |
« Reply #27 on: Feb 01, 2008, 08:15 AM » |
|
Did this stop working for anyone with the .9.6.1 update? once I updated, now when i click the next page button... the ?page=2 is appended to the url but is just displays the first page content.
---edit
It seems to be a caching issue. did modx change the way it caches items? It seems this was an old problem (looking at the beginning of this thread)
|
|
|
|
« Last Edit: Feb 01, 2008, 08:36 AM by betoranaldi »
|
Logged
|
|
|
|
rthrash
Foundation

Posts: 9,032
|
 |
« Reply #28 on: Feb 01, 2008, 08:35 AM » |
|
Is the page now set to be cacheable and/or (if used from Zap above) the snippet called cached?
|
|
|
|
|
Logged
|
MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
|
|
|
|
betoranaldi
|
 |
« Reply #29 on: Feb 01, 2008, 08:48 AM » |
|
Is the page now set to be cacheable and/or (if used from Zap above) the snippet called cached?
I'm using the original plugin (50% of my documents have multiple pages.) I have page caching on by default. I haven't had any problems using this plugin this way until i upgraded to 6.1 If i set it so the page does not cache then the plugin starts to work correctly. The only thing with this is that its going to be tough going through 200+ documents and changing them all to non-cacheable... nevermind the increased server load. Rather then downgrading to .9.6 i am going to use the snippet above uncached
|
|
|
|
« Last Edit: Feb 01, 2008, 01:00 PM by betoranaldi »
|
Logged
|
|
|
|
|