Page 1 keep active and don't have link. JPagination

by Tinagaran   Last Updated July 11, 2019 09:10 AM - source

I have create a pagination and the pages seems to work well when I edit in the url, but page 1 cannot be clicked and still active eventhough I changed to 2nd page and 3rd page. http://carplate2.satumalaysiahosting.com/component/sppagebuilder/?view=page&id=62&start=8

$db    = JFactory::getDbo();

$query = "SELECT COUNT(*) FROM `#__bidding_items` WHERE `state` = '1'";
$db->setQuery($query);

$total = $db->loadResult();

$limit=8;

$limitstart=0;

jimport('joomla.html.pagination');

$pagination = new JPagination($total, $limitstart, $limit);

echo $pagination->getPagesLinks(); 


Answers 1


You need to set $limitstart argument to the current start item. You can get the value from input:

$app        = JFactory::getApplication();
$limitstart = $app->input->getInt('limitstart', 0);

$pagination = new JPagination($total, $limitstart, $limit, $app);
Sharky
Sharky
July 11, 2019 08:42 AM

Related Questions


Changing look of pagination

Updated March 13, 2016 08:04 AM


Page break on my page shows as simple horizontal line

Updated December 05, 2016 08:04 AM