While using VirtualMart component, we may display other than 5 items per row. Using default pagination setting as 5, 10, 15, 20, 25, 30, 50, 100, all may cause alignment problem. In this case we would like use 4, 8, 12, 16, 20, 40, 80, all for 4 items per row.

Because this is hard-coded, we have to hack it in code.

file: libraries\joomla\html\pagination.php

In function getLimitBox(), line 324:

// Make the option list
for ($i = 5; $i <= 30; $i += 5) {
    $limits[] = JHTML::_(’select.option’, "$i");
}
$limits[] = JHTML::_(’select.option’, ‘50′);
$limits[] = JHTML::_(’select.option’, ‘100′);
$limits[] = JHTML::_(’select.option’, ‘0′, JText::_(’all’));

Change it to:

// Make the option list
for ($i = 4; $i <= 20; $i += 4) {
    $limits[] = JHTML::_(’select.option’, "$i");
}
$limits[] = JHTML::_(’select.option’, ‘40′);
$limits[] = JHTML::_(’select.option’, ‘80′);
$limits[] = JHTML::_(’select.option’, ‘0′, JText::_(’all’));

This will make global change for everywhere.

Leave a Reply

You must be logged in to post a comment.