2 minutes reading time (346 words)

Passing filter values via the url to Joomla Admin List Views

Passing filter values via the url to Joomla Admin List Views

We have already seen how you can introduce filters to list views in the Joomla admin & collate them under the Search tools menu previously in our Blog  last year. 

b2ap3_thumbnail_search_filters_joomla.png

The Search tools filters are extremely useful to admins especially if your extension manages a lot of data. As a usability feature, Joomla retains the state of the filters to the ones last used by the user. 

In most cases, manually setting the filters will work just great for Admins. However there are some cases when knowing how to set filter parameters via the URL can be very useful. 

You have set the Pagination Filter to show All Records and page times out due to overload

This can happen when you have lots of data in the system and by mistake the admin sets the filter to show all records. This leads to the page timing out and failing and giving you a white page of death. There is no way to manually set the filter in this case since Joomla remembers your last setting and you cant get the page back up to do it manually. In this case passing the count filter value can save you having to logout and restart a new session. 

Creating Quick Access links to the List view with Preset Filters. 

This can be useful for both Admins to bookmark as well as developers to create quick access links. With this you can create multiple configurations of preset filters and save the urls for them. These can be used by developers to give pre configured filter configurations to their users. 

Constructing the filter Url

If the default url for your component lis view is index.php?option=component_name&view=countries

You can append filters as below. 

index.php?option=component_name&view=countries&filter[state]=0

Here, the name of the filter is filter[state]. We need to pass this name along with the value of the filter. This will set the filter named as filter[‘state’] to value 0 overriding the previous user state. You can add additional filter values by appending the additional filters with an ampersand. 

Found the blog useful ? Do share it with your Joomla friends !

1
Shika Beta 13 gets you new dashboard widgets and m...
Overcome your crowdfunding challenges with JGive 1...

Related Posts