0

I have implemented a pagination technique and the pages seems to work well when I edit in the url, but page 1 cannot be clicked and is still active even though I have changed to the second or third 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(); 
0

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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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