Search Documentation

Create pre-filtered links

Create link that will automatically apply filter to list of the articles.

Link for order

If you want to create link outside of Cobalt to pre-ordered list of articles use this URL.

Basic rule is that you should take URL of the list of articles you want including all parameters like section_id, Itemid or cat_id or others and add 2 new parameters.

Parameter Req. Description
filter_order Yes How to order. See below.
filter_order_Dir Yes What is order direction. Can be asc or desc

List of possible ordering types

  • r.ctime - Time of creation
  • r.mtime - modification time
  • r.extime - time of expiration
  • r.title - Article title
  • name - Name of the author
  • username - User name od the author
  • r.hits - Article views
  • r.comments - Number of comments
  • r.favorite_num - Number of bookmarks
  • r.votes_result - Rating

If your URL is SEF like then you can use ?

Link for filters

What if you what to create link in menu (or anywhere else), that can automatically set search filters you want for articles list? For example: Events for the next 14 days with location 20 miles within the London. You can easily do it with new Cobalt filter interface.

1. Create URL

After dramatic recoding all filtering mechanism, we ended up with filter interface to which you can communicate through special URL.

Here are all parameters that you can add to this URL.

Parameter Req. Description
section_id Yes Set section ID
Itemid Yes Menu Itemid. Please set Itemid of menu that you set in section itemid parameter
cat_id No Category ID if you want to filter in particular category only
filter_name Yes Array of the name of the filters. Explained later.
filter_val Yes Array of the values of the filters. Explained later.

After user click URL, filters will be set and user will be redirected to standard articles list URL. That is why we need section ID, Itemid and category ID. To land user to correct page. So please do not forget to set those parameters correctly.

2. Reset and Set Filters

If you want to reset all filters before you set new one, add to URL &clean=1.

Otherwise filters will be added to curently applied filters.

3. Set Filters

filter_val and filter_name are arrays that set filters. You can add as many of them as you want. Here is the example.


This is to show all articles with tag ID 2.

Standard filters

This table show you list of available standard filter_name and their filter_val.

Filter name Filter value Description
filter_tpl default Name of the article list template. If you want to use settings of the template you have to include filter configuration key. Somethign like default.b604f5fb1ca89b8be2706881a530680f. how you can get this key? Just look temmplate select source code in section edit page.
filter_cat 2 ID of the category
filter_user 42 ID of the user
filter_tag 2 ID of the tag
filter_type 1 ID of the content type
filter_search what is life Search string

Here is an example. It should be one line. I have formatted it just to make it more readable.

This example will show all records of User Super Admin (ID 42) and content type ID 2.

Fields filters

First you have to form filter name. It contains of prefix filter_ and field key. So filter name may looks like this


Then, you have to set filter value. And it may be very different for every field but basically only 2 types. Single value may looks like this


Values have to be url encoded. You can see %20 means whitespace.

Or values may be an array


In this case it will look for records that contain Value 1 OR Value 2

Sometimes it is important to identify array keys like for example for geo field.


or date range


But that is very exclusive. Only Geo and DateTime fields. For data time first set is a data from and second date to

If you use boolean field then filter value is true OR false


Sometimes you need to reset all filters by URL or single filter.

Reset all filters


Reset individual filter


There are few parameters to insert to clean variable

Filter Type Description
filter_search Reset text search
filter_type Reset content type filter
filter_tag Reset tags filter
filter_user Reset user filter
filter_alpha Reset alpha index filter
filter_cat Reset category filter
filter_[key] This is to clean field filter. You have to change [key] to field key like it is in example above.

You may reset few filters at once


Q: What is a field key?

Field Key now is the part of multi type support in templates. Field key is and MD5 of field type and label.

$field_key = 'k'.md5($field->label.'-'.$field->field_type); 

Lets, say field label is Year and field type id digits. Then

$field_key = 'k'.md5('Year-digits');

You can find keys in the DB column key in jos_js_res_fields table.

Field key

Or in the key column in fields manager (3).

Field key