filter_code

The filter_code function follows a similar pattern to the filter function, with one key difference. Where the filter function returns the text value of the specified filter, filter_code returns the equivalent query string, which can be used to create the page applying that current filter.

Example

<form id="pricesearch" method="get" action="[@config:current_url@]">
    <input type="hidden" name="rf" value="[%FILTER_CODE id:'price'%][%/FILTER_CODE%]">
    <input  name="pr" type="hidden" value="">
    <input type="submit" value="Filter By Price" class="btn btn-default btn-xs" />
    <a href="[@remove_url@]" class="btn btn-default btn-xs" rel="nofollow"> clear</a>
</form>

This would generate a useable price query string, which is then applied to filter the page results by price.

filter_code parameters

Name Options Description
id:'' String The filter ID you would like to generate a query string for

Was this article useful?

Be notified when this page is updated. Optional.