News:

Looking for documentation? Take a look on our wiki

Main Menu

How i can remove Start/next... from pagination ?

Started by Pcwolf, January 24, 2014, 11:42:22 AM

Previous topic - Next topic

Pcwolf

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.

Pcwolf


jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Pcwolf

I think its a great solution but i get now this:



I think then its a css problem but then my buttons getting crazy if i disable some styles  :-\

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Pcwolf

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

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum