News:

Looking for documentation? Take a look on our wiki

Main Menu

setting up getPageLinks

Started by fabvincent, January 02, 2014, 15:49:24 PM

Previous topic - Next topic

fabvincent

Hi, 'been trying to change the vmPagination->getPagesLinks to have icons (<<  <     >  >>) instead of "begin" "Previous" 1 2 3 4  "end" etc on a category page I came to a stop on that vmPagination->getPagesLinks on the category/default.php.
I read through http://forum.virtuemart.net/index.php?topic=118805.0;prev_next=prev#new but don't find any of the indicated solution.
I'm running VM 2.0.26 on joomla 2.5
So in the end, the question is : What is generating the vmPagination->getPagesLinks on the category page and how can I change it and eventually overload it?
Thanks

fabvincent

Me again,
So I accidently bumped into http://forum.virtuemart.net/index.php?topic=112588.0 and it solved the problem. Thanks Lanthan
I resume for those who are looking for a solution :

1 - Create an Override for pagination (for some reason, VM's using the joomla default) and save it into yourtemplate/html/


<?php

defined
('JPATH_PLATFORM') or die;

   
/**
 * HTML Output
 */

function pagination_list_render($list)
{
// Reverse output rendering for right-to-left display.
$html '<ul class="ODPagination">';
$html .= '<li class="pagination-start">' $list['start']['data'] . '</li>';
$html .= '<li class="pagination-prev">' $list['previous']['data'] . '</li>';
foreach ($list['pages'] as $page)
{
$html .= '<li>' $page['data'] . '</li>';
}
$html .= '<li class="pagination-next">' $list['next']['data'] . '</li>';
$html .= '<li class="pagination-end">' $list['end']['data'] . '</li>';
$html .= '</ul>';

return $html;
}

/**
 * Method to create the new active pagination link to the item
 */
 
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
{
if ($item->text == (JText::_('JLIB_HTML_START')))
{
return "<a title=\"" $item->text "\" href=\"" $item->link "\" class=\"pagenavstart\">" . (JText::_('JLIB_HTML_START_IMG')) . "</a>";
  }
elseif ($item->text == (JText::_('JPREV')))
{
return "<a title=\"" $item->text "\" href=\"" $item->link "\" class=\"pagenavback\">" . (JText::_('JPREV_IMG')) . "</a>";
  }
  elseif ($item->text == (JText::_('JNEXT')))
  {
return "<a title=\"" $item->text "\" href=\"" $item->link "\" class=\"pagenavnext\">" . (JText::_('JNEXT_IMG')) . "</a>";
  }
  elseif ($item->text == (JText::_('JLIB_HTML_END')))
  {
return "<a title=\"" $item->text "\" href=\"" $item->link "\" class=\"pagenavend\">" . (JText::_('JLIB_HTML_END_IMG')) . "</a>";
  }
return "<a title=\"" $item->text "\" href=\"" $item->link "\" class=\"pagenav\">" $item->text "</a>";
}
}

/**
 * Method to create the new inactive pagination link to the item
 */
 
function pagination_item_inactive(&$item)
{
$app JFactory::getApplication();
if ($app->isAdmin())
{
return "<span>" $item->text "</span>";
}
else
{
if ($item->text == (JText::_('JLIB_HTML_START')))
{
return "<span class=\"pagenavstart\">" . (JText::_('JLIB_HTML_START_IMG')) . "</span>";
  }
  elseif ($item->text == (JText::_('JPREV')))
  {
    return "<span class=\"pagenavback\">" . (JText::_('JPREV_IMG')) . "</span>";
  }
  elseif ($item->text == (JText::_('JNEXT')))
  {
    return "<span class=\"pagenavnext\">" . (JText::_('JNEXT_IMG')) . "</span>";
  }
  elseif ($item->text == (JText::_('JLIB_HTML_END')))
  {
    return "<span class=\"pagenavend\">" . (JText::_('JLIB_HTML_END_IMG')) . "</span>";
  }   
return "<span class=\"pagenav\">" $item->text "</span>";
}
}

?>



2 - insert this code into your language overide root/language/overrides/xx-XX.overide.ini


JPREV="Previous"
JNEXT="next"
JLIB_HTML_END="End"
JLIB_HTML_START="Start"

JPREV_IMG="<img src='http://www.mysite.com/myfolder/pix/back.png'>"
JNEXT_IMG="<img src='http://www.mysite.com/myfolder/pix/prev.png'>"
JLIB_HTML_END_IMG="<img src='http://www.mysite.com/myfolder/pix/end.png'>"
JLIB_HTML_START_IMG="<img src='http://www.mysite.com/myfolder/pix/begin.png'>"


Pretty straight forward and it works.
:o