Change Default List Length Options in dropdown Global Config
-
- Joomla! Fledgling
- Posts: 2
- Joined: Wed Jan 21, 2009 4:52 am
Change Default List Length Options in dropdown Global Config
Ok, here's my problem. I need to change the options in the drop down box for list length in the Global Configuration area. Currently they're 5,10,15,20 - etc... I need it by 3s (ie 3,6,9).
I've looked everywhere and can't find where the options are coming from - help!
Thanks,
Lydia
ps. If I wasn't turning the site over to my client it wouldn't be a problem - I could just change the config file by hand anytime I edit anything in the global config, like meta-tags. But my client can't do that - so I need to change the drop down so it corresponds to our layout.
I've looked everywhere and can't find where the options are coming from - help!
Thanks,
Lydia
ps. If I wasn't turning the site over to my client it wouldn't be a problem - I could just change the config file by hand anytime I edit anything in the global config, like meta-tags. But my client can't do that - so I need to change the drop down so it corresponds to our layout.
-
- Joomla! Fledgling
- Posts: 2
- Joined: Wed Apr 29, 2009 10:32 am
Re: Change Default List Length Options in dropdown Global Config
Need help with the same thing - the only solutions I can find are old and not valid anymore.
- ooffick
- Joomla! Master
- Posts: 11615
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: Change Default List Length Options in dropdown Global Config
You would need to change the following file:
administrator/components/com_config/controllers/application.php
Olaf
administrator/components/com_config/controllers/application.php
Code: Select all
$listLimit = array (JHTML::_('select.option', 5, 5), JHTML::_('select.option', 10, 10), JHTML::_('select.option', 15, 15), JHTML::_('select.option', 20, 20), JHTML::_('select.option', 25, 25), JHTML::_('select.option', 30, 30), JHTML::_('select.option', 50, 50), JHTML::_('select.option', 100, 100),);
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Fledgling
- Posts: 2
- Joined: Wed Apr 29, 2009 10:32 am
Re: Change Default List Length Options in dropdown Global Config
Thanks! That changed the numbers in backend, but how do you get the same result in frontend? There it still says 5, 10, 15 etc.
- ooffick
- Joomla! Master
- Posts: 11615
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: Change Default List Length Options in dropdown Global Config
For that you will need to change this:
in the file libraries/joomla/html/pagination.php
Olaf
Code: Select all
/**
* Creates a dropdown box for selecting how many records to show per page
*
* @access public
* @return string The html for the limit # input box
* @since 1.0
*/
function getLimitBox()
{
global $mainframe;
// Initialize variables
$limits = array ();
// 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'));
$selected = $this->_viewall ? 0 : $this->limit;
// Build the select list
if ($mainframe->isAdmin()) {
$html = JHTML::_('select.genericlist', $limits, 'limit', 'class="inputbox" size="1" onchange="submitform();"', 'value', 'text', $selected);
} else {
$html = JHTML::_('select.genericlist', $limits, 'limit', 'class="inputbox" size="1" onchange="this.form.submit()"', 'value', 'text', $selected);
}
return $html;
}
Olaf
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Fledgling
- Posts: 1
- Joined: Sun Feb 07, 2010 8:41 pm
Re: Change Default List Length Options in dropdown Global Config
I need to change the options in the drop down box for product list length in Yootheme Zoo to 6 and not 5, 10, 15 etc... But how?
-
- Joomla! Apprentice
- Posts: 21
- Joined: Sat Mar 15, 2008 10:38 am
Re: Change Default List Length Options in dropdown Global Config
Hello, thanks for your help. I followed your instructions and managed to get this to work, except thant the dropdown list on the frontend is not showing the list as I wanted to.
On the backend it works great, in settings and in any other dropdown (like article manager)
I guess some other adjustment must be made but I can't find the correct file.
Thank you very much
On the backend it works great, in settings and in any other dropdown (like article manager)
I guess some other adjustment must be made but I can't find the correct file.
Thank you very much
- bluesardine
- Joomla! Guru
- Posts: 502
- Joined: Fri Nov 16, 2007 10:49 pm
- Location: Oxford
- Contact:
Re: Change Default List Length Options in dropdown Global Co
Hi guys
This below quote, please advise as I only want to show 4 or 6 products what would I do here?
This below quote, please advise as I only want to show 4 or 6 products what would I do here?
ooffick wrote:For that you will need to change this:
in the file libraries/joomla/html/pagination.phpCode: Select all
/** * Creates a dropdown box for selecting how many records to show per page * * @access public * @return string The html for the limit # input box * @since 1.0 */ function getLimitBox() { global $mainframe; // Initialize variables $limits = array (); // 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')); $selected = $this->_viewall ? 0 : $this->limit; // Build the select list if ($mainframe->isAdmin()) { $html = JHTML::_('select.genericlist', $limits, 'limit', 'class="inputbox" size="1" onchange="submitform();"', 'value', 'text', $selected); } else { $html = JHTML::_('select.genericlist', $limits, 'limit', 'class="inputbox" size="1" onchange="this.form.submit()"', 'value', 'text', $selected); } return $html; }
Olaf
Joomla Web designer Oxford https://www.swankypixels.com
Architectural Photographer UK https://www.peterhaken.com
Architectural Photographer UK https://www.peterhaken.com
- draftvader
- Joomla! Explorer
- Posts: 321
- Joined: Sun Jun 15, 2008 11:52 am
- Location: Bangkok, Thailand
- Contact:
Re: Change Default List Length Options in dropdown Global Co
Hacked it
Change from:
to
Good luck
Change from:
Code: Select all
// 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'));
Code: Select all
// Make the option list
for ($i = 1; $i <= 30; $i += 1) {
$limits[] = JHTML::_('select.option', "$i");
}
$limits[] = JHTML::_('select.option', '4');
$limits[] = JHTML::_('select.option', '6');
$limits[] = JHTML::_('select.option', '0', JText::_('all'));
- draftvader
- Joomla! Explorer
- Posts: 321
- Joined: Sun Jun 15, 2008 11:52 am
- Location: Bangkok, Thailand
- Contact:
Re: Change Default List Length Options in dropdown Global Co
Sorry, nearly forgot. Make sure you do a complete browser clean after making the change. This did NOT want to display the change with a simple CTRL+F5