If you want to create link outside of Cobalt to pre-ordered list of articles use this URL.
http://www.com/index.php?option=com_cobalt& view=records& section_id=1& filter_order=r.title& filter_order_Dir=asc
Basic rule is that you should take URL of the list of articles you want including all parameters like
cat_id or others and add 2 new parameters.
||How to order. See below.|
||What is order direction. Can be
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
If your URL is SEF like
http://domain.com/list then you can use
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.
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.
|section_id||Set section ID|
|Itemid||Menu Itemid. Please set Itemid of menu that you set in section itemid parameter|
|cat_id||Category ID if you want to filter in particular category only|
|filter_name||Array of the name of the filters. Explained later.|
|filter_val||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.
If you want to reset all filters before you set new one, add to URL
Otherwise filters will be added to curently applied filters.
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.
This table show you list of available standard
filter_name and their
|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
|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.
http://www.com/index.php ?option=com_cobalt &task=records.filter §ion_id=2 &Itemid=126 &filter_name=filter_type &filter_val=2 &filter_name=filter_user &filter_val=42
This example will show all records of User Super Admin (ID 42) and content type ID 2.
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
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
Sometimes you need to reset all filters by URL or single filter.
index.php?option=com_cobalt &task=records.cleanall §ion_id=2 &Itemid=123
index.php?option=com_cobalt &task=records.clean &clean[filter_k58596481bc7070e4adecd4f2e29569de]=1 §ion_id=2 &Itemid=123
There are few parameters to insert to clean variable
||Reset text search|
||Reset content type filter|
||Reset tags filter|
||Reset user filter|
||Reset alpha index filter|
||Reset category filter|
||This is to clean field filter. You have to change
You may reset few filters at once
index.php?option=com_cobalt &task=records.clean &clean[filter_k58596481bc7070e4adecd4f2e29569de]=1 &clean[filter_type]=1 &clean[filter_alpha]=1 §ion_id=2 &Itemid=123
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
Or in the key column in fields manager (3).