Pagination in pagelist
Permalink 1 user found helpful
Could anyone help me to get paging in pagelists. I have seen there is a PaginationHelper how can i use this?
Cheers for your post.
Just need to work out how to only paginate a specific area on the page and not every page list.
Just need to work out how to only paginate a specific area on the page and not every page list.
You could make a theme for the page list block that includes your pagination commands and apply it to those page lists you want pagination-ized.
(wordsmithing is fun)
(wordsmithing is fun)
I'm not sure where to add the code...
Does it need to be added in the controller.php?
Does it need to be added in the controller.php?
Basically what I did was create a new template in /blocks/page_list/templates with the following code;
Then I assigned the template to the page list.
Hope that makes sense. Give me a shout (ben[at]oi[hypen]you[dot]com) if not and Ill try to explain it better.
Cheers.
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $textHelper = Loader::helper("text"); // now that we're in the specialized content file for this block type, // we'll include this block type's class, and pass the block to it, and get // the content $reservedParams = array('page=','query=','search_paths[]=','submit=','search_paths%5B%5D=','all' ); $pages = $cArray; $pagination = Loader::helper('pagination'); //pagination $pageSize=4; $page=intval($_REQUEST['page']); #print $page; global $c; $cID=$c->getCollectionId();
Viewing 15 lines of 76 lines. View entire code block.
Then I assigned the template to the page list.
Hope that makes sense. Give me a shout (ben[at]oi[hypen]you[dot]com) if not and Ill try to explain it better.
Cheers.
Here's my code including thumbnail image in the list. Also some inline css, for pagination layout.
You never now someone might need it.
You never now someone might need it.
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $textHelper = Loader::helper("text"); // now that we're in the specialized content file for this block type, // we'll include this block type's class, and pass the block to it, and get // the content $reservedParams = array('page=','query=','search_paths[]=','submit=','search_paths%5B%5D=','all' ); $pages = $cArray; $pagination = Loader::helper('pagination'); //pagination $pageSize=6; $page=intval($_REQUEST['page']); #print $page; global $c; $cID=$c->getCollectionId();
Viewing 15 lines of 106 lines. View entire code block.
This controller works great with the exception of the thumbnail becomming an emtpy string. I've used an image field property.
I would assume that the imagefield attribute returns an url to the image. Any suggestions how to debug this? (keep in mind that I'm not a programmer, rather a html/css designer)
Thanks in advance
I would assume that the imagefield attribute returns an url to the image. Any suggestions how to debug this? (keep in mind that I'm not a programmer, rather a html/css designer)
Thanks in advance
Thanks a lot, that was really helpful! :)
Just to let you know that I've try the template with 600 pages and it's extremely slow, took like 50 second before returning all the data on every request.
@Olacom - did you find a faster solution to this? I need to create a way for visitors to look through around 10 sections with 1000+ pages each section...was thinking this might be a solution, but starting to think not!
Any pointers massively appreciated
Any pointers massively appreciated
Humm since they added the new block cache system into the last version, I think it does help alot since it cache the data after the first run for x amount of time.
APC help alot too.
APC help alot too.
In pagelist blok define:
In getPages() in the pagelist blok add: