The Joomla! Forum ™





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
PostPosted: Tue Oct 20, 2009 6:18 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Jan 21, 2009 4:52 am
Posts: 2
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! :D

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.


Top
 Profile  
 
PostPosted: Thu Oct 22, 2009 1:05 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Apr 29, 2009 10:32 am
Posts: 2
Need help with the same thing - the only solutions I can find are old and not valid anymore.


Top
 Profile  
 
PostPosted: Thu Oct 22, 2009 2:40 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Thu Jul 17, 2008 3:10 pm
Posts: 10783
Location: Ireland
You would need to change the following file:
administrator/components/com_config/controllers/application.php

Code:
$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

_________________
Olaf Offick - Global Moderator
http://learnskills.org


Top
 Profile  
 
PostPosted: Thu Oct 22, 2009 5:11 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Apr 29, 2009 10:32 am
Posts: 2
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.


Top
 Profile  
 
PostPosted: Thu Oct 22, 2009 6:49 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Thu Jul 17, 2008 3:10 pm
Posts: 10783
Location: Ireland
For that you will need to change this:

Code:
   /**
    * 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;
   }


in the file libraries/joomla/html/pagination.php

Olaf

_________________
Olaf Offick - Global Moderator
http://learnskills.org


Top
 Profile  
 
PostPosted: Sun Feb 07, 2010 8:46 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Sun Feb 07, 2010 8:41 pm
Posts: 1
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?


Top
 Profile  
 
PostPosted: Tue Apr 13, 2010 8:28 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Mar 15, 2008 10:38 am
Posts: 16
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


Top
 Profile  
 
PostPosted: Mon Nov 01, 2010 9:36 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Fri Nov 16, 2007 10:49 pm
Posts: 375
Location: Cheltenham, Gloucestershire, UK
Hi guys

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:

Code:
   /**
    * 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;
   }


in the file libraries/joomla/html/pagination.php

Olaf

_________________
http://www.cotswold-designs.co.uk
http://www.urban-energy.co.uk


Top
 Profile  
 
PostPosted: Thu Jan 20, 2011 2:16 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Sun Jun 15, 2008 11:52 am
Posts: 316
Location: Bangkok, Thailand
Hacked it

Change from:

Code:
// 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'));


to

Code:
// 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'));


Good luck :)

_________________
http://www.theorganicweb.co.uk

"Geek is all I've got. That and my sweet style" - Moss, IT Crowd


Top
 Profile  
 
PostPosted: Thu Jan 20, 2011 2:17 am 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Sun Jun 15, 2008 11:52 am
Posts: 316
Location: Bangkok, Thailand
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

_________________
http://www.theorganicweb.co.uk

"Geek is all I've got. That and my sweet style" - Moss, IT Crowd


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 



Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group