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?
Joomla Stack Exchange is a question and answer site for Joomla! administrators, users, developers and designers. It only takes a minute to sign up.
Sign up to join this communityThe 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.
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.
You can try this, but it's a core hack and not the proper way(for Joomla 3.3.0):
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>
Add your own values like this
<option value="500">J500</option>