Page numbers only display at the bottom

Permalink
Hi,

I would like the page numbers to display at the top of the page not the bottom. But even when I drag them to the top of the page they still display at the bottom.

Can you please advise how to get the page number to display at the top?

Cheers in advance!

Tags:

damshaw
View Replies: View Best Answer
smartwebprojects replied on at Permalink Best Answer Reply
smartwebprojects
The default block template outputs the page content first and then the pagination links.

To make the pagination display above the page content, you can edit the block template (default location: /packages/swp_pagination/blocks/swp_pagination/view.php):

FIND THIS LINE:

$this->controller->printPageContent($page);


MOVE THAT LINE AFTER

echo '<a href="'.$pagelink.'" class="swp-pagination-link'.$ajax_link_class.$active_class.'">'.$i.'</a> ';
}


So, the result code will look like this:

<?php  defined('C5_EXECUTE') or die(_("Access Denied.")); 
global $c;
$nh = Loader::helper("navigation");
?>
<div class="swp-pagination">
<?php
$page = intval($_GET["p"]);
if ($page < 1)
   $page = 1;
echo t('Pages:').' ';
for ($i=1; $i<=$pages_num; $i++) {
      if ($c->getCollectionID() > 1) {
         $pagelink = $nh->getCollectionURL($c);
      } else {
         $pagelink = DIR_REL.'/';


This way pagination will be displayed above the page contents.
damshaw replied on at Permalink Reply
damshaw
Thanks you the quick response, I will give it a go tomorrow!

Any chance in the future pagination will work with mutliple on one page?