Pagination works wrong on category list

February 2014 Joomla Template
Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Wed Aug 19, 2015 8:57 am
Reply with quote
Report this post
I have in template NEWS 2 some issue with pagination on Joomla 2.5 Category List view (view all articles in 1 Joomla core category) and also in K2 Category view (view all articles in 1 Joomla K2 category) .

Joomla category view examples:
http://www.silvarium.cz/zpravy-z-oboru-lesnictvi-a-drevarstvi
http://www.silvarium.cz/zpravy-z-oboru-myslivost

K2 category view examples:
http://www.silvarium.cz/vsechny-zpravy
http://www.silvarium.cz/lesnictvi

First 6 pages are shown right and from 9.page is that only way to go forward or back is click on"Start" or "Previous" or "Next" or "End", and after that numbers don't exist... So it is really hard to navigate.

Navigation appearance
1.page:
Start - Previous - 1 - 2 - 3 - ... - Next - End
2.page
Start - Previous - 1 - 2 - 3 - 4 - ... - Next - End
3.page
Start - Previous - 1 - 2 - 3 - 4 - 5 - ... - Next - End
4.page
Start - Previous - …- 2 - 3 - 4 - 5 -6 - ... - Next - End
5.page
Start - Previous - …- 3 - 4 - 5 - 6 - 7 - ... - Next - End
6.page
Start - Previous - …- 4 - 5 - 6 - 7 - 8 - ... - Next - End
7.page
Start - Previous - 2 - 3 - ... - Next - End
8.page
Start - Previous - 3 - ... - Next - End
9.page and all other page
Start - Previous - ... - Next - End


I think that is some problem in file html/pagination.php in template
Thanks in advance
User avatar
Senior Boarder

GK User
Wed Aug 19, 2015 9:42 am
Reply with quote
Report this post
I'll report that issue to our devteam.
But before that, please verify if your template is updated (and provide here the info)
User avatar
Moderator

GK User
Wed Aug 19, 2015 10:04 am
Reply with quote
Report this post
My template NEWS 2 is in version Gavern v.3.11.3 (23.March 2014), in download section for joomla template is not visible actuall version for templates.
User avatar
Senior Boarder

GK User
Wed Aug 19, 2015 10:07 am
Reply with quote
Report this post
There is PHP code for file html/pagination.php from template:

<?php
// Pagination override
// no direct access
defined('_JEXEC') or die('Restricted access');
function pagination_list_render($list) {
// Reverse output rendering for right-to-left display.
$html = '<nav class="pagination"><ul>';
$html .= '<li class="pagination-start">'.$list['start']['data'].'</li>';
$html .= '<li class="pagination-prev">'.$list['previous']['data'].'</li>';

if(count($list['pages']) >= 7) {
$founded = false;

for($i = 1; $i <= count($list['pages']); $i++) {
if($list['pages'][$i]['active'] != 1) {
$founded = $i;
break;
}
}

for($i = 1; $i <= count($list['pages']); $i++) {
if($i == 1 && $founded > $i + 2) {
$html .= '<li><span>&hellip;</span></li>';
}

if($i == count($list['pages']) && $founded < $i - 2) {
$html .= '<li><span>&hellip;</span></li>';
}

if($i >= $founded - 2 && $i <= $founded + 2) {
$html .= '<li>'.$list['pages'][$i]['data'].'</li>';
}
}
} else {
for($i = 1; $i <= count($list['pages']); $i++) {
$html .= '<li>'.$list['pages'][$i]['data'].'</li>';
}
}

$html .= '<li class="pagination-next">'. $list['next']['data'].'</li>';
$html .= '<li class="pagination-end">'. $list['end']['data'].'</li>';
$html .= '</ul></nav>';

return $html;
}

function pagination_item_active($item) {
$app = JFactory::getApplication();

if ($app->isAdmin()) {
if ($item->base > 0) {
return "<a title=\"".$item->text."\" onclick=\"document.adminForm." . $this->prefix . "limitstart.value=".$item->base."; Joomla.submitform();return false;\">".$item->text."</a>";
} else {
return "<a title=\"".$item->text."\" onclick=\"document.adminForm." . $this->prefix . "limitstart.value=0; Joomla.submitform();return false;\">".$item->text."</a>";
}
} else {
return "<a title=\"".$item->text."\" href=\"".$item->link."\" class=\"pagenav\">".$item->text."</a>";
}
}

function pagination_item_inactive($item) {
$app = JFactory::getApplication();

if ($app->isAdmin()) {
return "<span>".$item->text."</span>";
} else {
return "<span class=\"pagenav\">".$item->text."</span>";
}
}

// EOF
User avatar
Senior Boarder

GK User
Wed Aug 19, 2015 10:21 am
Reply with quote
Report this post
You chan check current version and release date in templates/gk_news2/templateDetails.xml file. Current one shows:
Code: Select all
          <creationDate>16 Jul 2015</creationDate>
          <author>GavickPro</author>
          <authorEmail>[email protected]</authorEmail>
          <authorUrl>http://gavick.com</authorUrl>
          <copyright>Copyright (C) 2007 - 2015 GavickPro. All rights reserved.</copyright>
          <license></license>
          <version>3.18</version>
User avatar
Moderator

GK User
Wed Aug 19, 2015 12:05 pm
Reply with quote
Report this post
From templates/gk_news2/templateDetails.xml file:
version: 3.11.3
creationDate: 25 Mar 2014
User avatar
Senior Boarder

GK User
Fri Aug 21, 2015 7:29 am
Reply with quote
Report this post
Then you should start from updating as your template is almost one year outdated.
User avatar
Moderator

GK User
Fri Aug 21, 2015 9:40 am
Reply with quote
Report this post
I update file html/pagination.php from last version of template, but this file is same,
display pagination problem persists.
User avatar
Senior Boarder

GK User
Fri Aug 21, 2015 2:47 pm
Reply with quote
Report this post
I solved problems by canceling file html/pagination.php in the template and by slight editing the file libraries/joomla/html/pagination.php, even if it is non-systemic solutions.

Now pagination works correctly.
User avatar
Senior Boarder

GK User
Mon Aug 24, 2015 1:06 pm
Reply with quote
Report this post
This is definitely not a good idea to edit Joomla core files. You will fail with next Joomla update :(.
User avatar
Moderator


cron