Page List Pagination

Permalink 1 user found helpful
I've added a Page List block and I've checked the option to display pagination (Pagination: Display pagination interface if more items are available than are displayed.).

Well that works just fine, but how can I change the pagination function?! The view.php has got this code to run the pagination function.
if ($paginate && $num > 0 && is_object($pl)) {
But I can't discover where to find this function in Concrete.

Can anybody help me? I want to change the standard HTML coding of this function:
<div class="ccm-spacer"></div>
<div class="ccm-pagination">
   <span class="ccm-page-left">
      <span class="ltgray">« Previous</span>
   <span class="ccm-page-right">
      <span class=""><a href="/nieuws?ccm_paging_p_b290=2" >Next »</a>
   <span class='currentPage'>
   <span class=''>
      <a href='/nieuws?ccm_paging_p_b290=2' >2</a>

View Replies: View Best Answer
davygee replied on at Permalink Reply
I need to be able to style up the paginate feature as well, any help would be brilliant.
jordanlev replied on at Permalink Reply
Depending on what kind of customization you want, you might be able to do this by creating a custom template for the page_list block (by copying yoursite/concrete/blocks/page_list/view.php to yoursite/blocks/page_list/view.php) and changing the "$pl->displayPaging();" code in that new file to something like this:
$summary = $pl->getSummary();
if ($summary->pages > 1):
   $paginator = $pl->getPagination();
   <div class="ccm-spacer"></div>
   <div class="ccm-pagination">
   <span class="ccm-page-left"><?php echo $paginator->getPrevious('Your own custom Previous Entries Link Text'); ?></span>
   <span class="ccm-page-right"><?php echo $paginator->getNext('Your own custom Next Entries Link Text'); ?></span>
   <?php echo $paginator->getPages(); ?>
<?php endif; ?>

...or whatever it is you want to do with the html. Check out the yoursite/concrete/helpers/pagination.php file to see what functions are available from the $paginator object.

Hope that helps!

-Jordan Lev

UPDATE: I've posted a write-up about this here:
MrNiceGaius replied on at Permalink Reply
Great write up, exact details on how to customize the pagination from a page list template. thanks Jordan!!!
Tony replied on at Permalink Best Answer Reply
there's a pagination class in /concrete/helpers/pagination.php

you should be able to find some example of how to use it if you just search for:

davygee replied on at Permalink Reply
I can't overwrite the concrete core directory as I'm with the official C5 hosting. Is there a way I could call the same function up outwith the concrete/helpers folder to get it to work. Cheers for all your help.
mose replied on at Permalink Reply
You never want to overwrite Concrete core files, no matter who is hosting your web site. If you want to change core functionality, copy pagination.php to the site "helpers" directory at the top level and change your copy to suit your needs. You are responsible, then, for making any additional changes to your code when new versions of Concrete5 are installed.
davygee replied on at Permalink Reply
If I copy the pagination.php from the concrete helpers folder and place in the root helpers folder it states the following:

Fatal error: Cannot redeclare class paginationhelper in /home/barrandwray/public_html/helpers/pagination.php on line 20

What can I do to sort this out?
mose replied on at Permalink Reply
If all you did was copy the file to the top-level helpers directory, then this is a bug. Files in the helpers directory (and all other top-level directories) should override files on the corresponding concrete directories.

If you modified the file and duplicated the paginationhelp class, that would cause the error you see. That gets into the realm of PHP programming.
BigBobbyD replied on at Permalink Reply
davygee - Did you ever get this sorted?

I'm having the same problem in 5.4.0. Copying the pagination.php to the root /helpers folder throws the exact same error. The file is not modified at all: copied as-is from /concrete/helpers.

There must be a way to modify the view of the page list pagination, but I haven't found it after more than an hour of searching around the forums.

Per Andrew's advice here: , I'm calling on the page_list class directly, rather than instantiating a block, and therefore I can't attach a template to it, as suggested here (at least I don't think I can?):

If you have made any progress, I would be very grateful for a little help!
mose replied on at Permalink Reply
After looking at the code, I discovered that helpers are different from blocks, models and libraries. At this time, you cannot override a helper with a local file. I have submitted a patch to make helpers like the other items, and I am waiting for feedback on the patch. See this thread.
madmichael replied on at Permalink Reply
I know this is an older thread, but for reference everything can now be overridden in a package using overrideCoreByPackage See for examples