filter[Permalink]The filter attribute of the fields.ini fileThe filter attribute with a value of 1 specifies that a field should be used as a filter field in list view. In list view, any filter fields will provide a select list with all of the possible values in that field. Selecting one of the items in this list will filter the results to only show records of that value. Example 1: Year, Make, ModelThe Fuel Economy Database has three fields with filter=1 : Year, Make, and Model. I.e., in their fields.ini file we have something like:
This causes 3 select lists to appear in list view. See the application here and notice the select lists for Year, Make, and Model just above the list of results. If you are filtering on a field where an ID is stored in the DB but you are using a vocabulary to associate it with a value, then it will still be sorted on the ID. If you want to sort on value then you should add a grafted field with the value using the __sql__ directive of the fields.ini file, then use that grafted field as your filter field, like the following:
blog comments powered by Disqus
|