VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Pcwolf on January 24, 2014, 11:42:22 AM

Title: How i can remove Start/next... from pagination ?
Post by: Pcwolf on January 24, 2014, 11:42:22 AM
Hi!

I just can't find here on forums how i can delete the start, next, end etc.. text from pagination ?
I just want numbers: 1 , 2 3,... ?

/templates/d4444/html/com_virtuemart/category/default.php then i don't see that tags only this code:

<div class="vm-pagination"><?php echo $this->vmPagination->getPagesLinks (); ?><span style="float:right"><?php echo $this->vmPagination->getPagesCounter (); ?></span></div>


Can someone help me please, have the newest version of vm.
Title: Re: How i can remove Start/next... from pagination ?
Post by: Pcwolf on January 24, 2014, 13:09:02 PM
Maybe it is in a plugin or something ?
Title: Re: How i can remove Start/next... from pagination ?
Post by: jenkinhill on January 25, 2014, 16:38:25 PM
There are not any individual classes or id's for each of the links. You can use language overrides to replace the words with empty strings. The constants are:
JPREV
JLIB_HTML_START
JNEXT
JLIB_HTML_END

http://forum.virtuemart.net/index.php?topic=113895.0

Note that this will remove start/next etc wherever they appear.
Title: Re: How i can remove Start/next... from pagination ?
Post by: Pcwolf on January 26, 2014, 15:20:52 PM
I think its a great solution but i get now this:

(http://i43.tinypic.com/21l4wpg.png)

I think then its a css problem but then my buttons getting crazy if i disable some styles  :-\
Title: Re: How i can remove Start/next... from pagination ?
Post by: jenkinhill on January 26, 2014, 17:22:04 PM
Changing the strings won't work so well if you have css generated buttons.  As the pagination code is part of Joomla rather than VM a different approach would be to edit /plugins/content/pagenavigation/pagenavigation.php

Problem with this is that you will have to re-apply the edits whenever you update Joomla.
Title: Re: How i can remove Start/next... from pagination ?
Post by: Pcwolf on January 27, 2014, 10:28:58 AM
It don't works, tried to delete all the code from that php page but nothing.

I found another way, easy:

/templates/templatesname/html/pagination.php

<?php

defined
('_JEXEC') or die;

function 
pagination_list_render($list)
{
// Initialise variables.
$lang JFactory::getLanguage();
$html "<div class=\"pager\">";

$html .= str_replace("pagenav"$list['start']['active'] ? "" "active"$list['start']['data']);

$html .= str_replace("pagenav"$list['previous']['active'] ? "" "active"$list['previous']['data']);

foreach($list['pages'] as $page) {
$html .= str_replace("pagenav", !$page['active'] ? "active" ""$page['data']);
 
}

$html .= str_replace("pagenav"$list['next']['active'] ? "" "active"$list['next']['data']);

$html .= str_replace("pagenav"$list['end']['active'] ? "" "active"$list['end']['data']);

$html .= "</div>";
return $html;
}


Delete the start/prev and next/end, it works  ;D
Title: Re: How i can remove Start/next... from pagination ?
Post by: jenkinhill on January 27, 2014, 11:29:40 AM
Joomla override - good idea!