0

I have an issue where the pagination in K2 Category layout is not showing the active class on the correct element.

This page is an example https://realsport101.com/news/page-3

This is showing the active class on page 2 when it should be shown on page 3:

The code in templates/template_name/html/com_k2/default/category.php is:

<div class="k2Pagination">
    <?php if($this->params->get('catPagination')) echo $this->pagination->getPagesLinks(); ?>
    <div class="clr"></div>
    <?php if($this->params->get('catPaginationResults')) echo $this->pagination->getPagesCounter(); ?>
</div>

I don't think this is an override issue as the default code in /components/com_k2/templates/default/category.php is:

<div class="k2Pagination">
    <?php if($this->params->get('catPagination')) echo $this->pagination->getPagesLinks(); ?>
    <div class="clr"></div>
    <?php if($this->params->get('catPaginationResults')) echo $this->pagination->getPagesCounter(); ?>
</div>

Which is exactly the same

  • Your template is using an override for the category view. When you update K2, the overrides do not update with it, so it's possible that it contains outdated code. I would suggest copying the coping the original view file (components/k2/views/category/default.php I think), putting it in your override, and re-add the styling changes you require. – Lodder Nov 14 '16 at 11:25
  • Perhaps get the 2 files in an editor (side by side) and compare them to see if there are any PHP differences first. – Lodder Nov 14 '16 at 11:26
  • Have you also made sure you're running the latest version of K2? – Lodder Nov 14 '16 at 12:12

Your Answer

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

Browse other questions tagged or ask your own question.