9

How can I add custom value to Site Settings > Default List Limit in Joomla 3.X?

I can see dropdown menu with values 5, 10, 15, 20, 25, 30, 50, 100 there.

I would like to add item 500.

Can be the choice Unlimited added/implemented easily, too?

6

The backend setting doesn't show the "All" option that is presented when a List Limit item is shown in paginated view but it does exist. So, you shouldn't need an "Unlimited" option in the configuration as it's added to the limit list when the pagination object is created.

e.g. you can see the "All" option at the bottom of this selector.

Joomla 3.3 Pagination Limit Selector

I'm not aware of a direct way, in the past we've hacked the core but we don't recommend that due the issues this causes when you apply updates down track. I'm guessing you want a persistent modification that won't be over-written by any Joomla updates that will be released in the future.

This is just speculation, but, you will probably need to write a system/content plugin to modify Joomla's behaviour in two places,first the com_config form for the Joomla application (application.xml), you will need to add the extra value(s) you want to the form element list_limit. I'd probably start by trying the onBeforeRender or onContentPrepareForm triggers.

Then, I imagine you will need to modify the JPagination object so that it also shows your additional value(s). As pagination objects are used in manager view (at least in the backend) I'm not sure which event you would want to capture, I'd investigate onAfterInitialise, onAfterRoute, onBeforeRender, onContentPrepare and onContentBeforeDisplay.

Those first three triggers are very early on in the apps life, but I'm not sure how early/late you can make the changes you need.

  • How about just raising a tracker item to have this changed in the core? – Peter Wiseman May 9 '14 at 3:36
  • I'm assuming the OP wants a solution now. It's certainly been suggested and submitted previously but I'm not sure it has since the move to github. – Craig May 9 '14 at 3:44
2

You can try this, but it's a core hack and not the proper way(for Joomla 3.3.0):

  1. Open the file /administrator/components/com_config/models/forms/application.xml
  2. Search for this

        <field
        name="list_limit"
        type="list"
        default="20"
        label="COM_CONFIG_FIELD_DEFAULT_LIST_LIMIT_LABEL"
        description="COM_CONFIG_FIELD_DEFAULT_LIST_LIMIT_DESC"
        filter="integer">
        <option value="5">J5</option>
        <option value="10">J10</option>
        <option value="15">J15</option>
        <option value="20">J20</option>
        <option value="25">J25</option>
        <option value="30">J30</option>
        <option value="50">J50</option>
        <option value="100">J100</option>
    </field>
    
  3. Add your own values like this

    <option value="500">J500</option>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.