<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">
    <channel>
        <title>filter[ Search for &quot;&quot;]</title>
        <description></description>
        <link>http://xataface.com/wiki/index.php?-action=single_record_search&amp;-table=wiki&amp;page_id=%3D27&amp;-cursor=0&amp;-skip=0&amp;-limit=30&amp;-mode=list&amp;--subsearch=</link>
        <lastBuildDate>Mon, 20 May 2013 08:15:21 +0100</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>filter</title>
            <link>http://www.xataface.com/wiki/filter</link>
            <description>&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Field&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page name&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;filter&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page id&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;27&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Page title&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;filter&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Content&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;
&lt;h2 id=&quot;toc0&quot;&gt;The filter attribute of the &lt;a href=&quot;/wiki/fields.ini_file&quot;&gt;fields.ini file&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The 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.&lt;/p&gt;


&lt;h3 id=&quot;toc1&quot;&gt;Example 1: Year, Make, Model&lt;/h3&gt;
&lt;p&gt;The Fuel Economy Database has three fields with filter=1 : Year, Make, and Model.  I.e., in their fields.ini file we have something like:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;[Year]
    filter=1

[Make]
    filter=1

[Model]
    filter=1&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This causes 3 select lists to appear in list view.  See the application &lt;a href=&quot;http://fueleconomydb.com/index.php?-action=list&quot; onclick=&quot;window.open(this.href, '_blank'); return false;&quot;&gt;here&lt;/a&gt; and notice the select lists for Year, Make, and Model just above the list of results.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;If you want to sort on value then you should add a &lt;a href=&quot;/wiki/Grafted_fields&quot;&gt;grafted field&lt;/a&gt; with the value using the __sql__ directive of the fields.ini file, then use that grafted field as your filter field, like the following:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;__sql__ = &amp;quot;select a.*, b.foo_name from a left join b on a.foo_id=b.foo_id&amp;quot;

[foo_name]
filter=1&lt;/code&gt;&lt;/pre&gt;

&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;Language&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;en&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</description>
            <author>filter</author>
        </item>
    </channel>
</rss>
