5

I need to move the |Next/Prev* buttons, located in the pagenavigation plugin to after the <jdoc:include type="component" />; Basically render it anywhere in my templates' index.php?

Any ideas as to how I can achieve this?

1 Answer 1

5

Edited

Assuming you have created a template override of the article view, then you have to modify a few things at templates\mytemplate\html\com_content\article\default.php

Declare a global variable as below

global $myPageNavigation;
$myPageNavigation = $this->item->pagination;

Remove all the snippets that render the pagination which are associated to paginationposition and paginationrelative.

Then place the code below anywhere in your template\mytemplate\index.php

echo $GLOBALS['myPageNavigation'];

That is't, just a POC though.

Previous Answer

Assuming your Joomla version is 2.5.x or 3.x, below is my pseudo concept using JPagination, JInput and by creating a simple pagination module.

First, in your component's view, you need to remove the snippet that render the pagination and also set three JInput values which are required for your pagination module.

$jinput = JFactory::getApplication()->input;
$jinput->set( 'total', $total);
$jinput->set( 'limitstart', $limitstart);
$jinput->set( 'count', $count);

Then implement a module to render a pagination something like below,

$jinput = JFactory::getApplication()->input;
$total = $jinput->getInt( 'total', 0);
$limitstart = $jinput->getInt( 'limitstart', 0);
$count = $jinput->getInt( 'count', 10);
jimport('joomla.html.pagination');
$pageNav = new JPagination($total, $limitstart, $count);

and you can echo the pagination in your module's view something like

echo $pageNav->getResultsCounter(); 
echo $pageNav->getPagesLinks();
echo $pageNav->getPagesCounter();

Finally, assign your module to any position in your template which must also be associated with your component's menu.

3
  • Hey, that's awesome, but unfortunately I don't need the pagination. It's the page navigation [next and prev buttons for articles] that I need. I have assumed that this can't be done due to the way the 'page nav' is built from a category.
    – matty
    Commented Oct 1, 2015 at 12:37
  • My mistake, since your question isn't very clear. Answer has been updated. Hope that helps :) Commented Oct 1, 2015 at 14:48
  • Ahhh, Clever! Nice little work around. Thanks!!
    – matty
    Commented Oct 1, 2015 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.