Redicom Help Center

filter

filter.name

Version 1.0

Returns the value of the name field of the filter.

{% for item in response.filters %}
<p><b>{{item.name}}</b></p>
{% endfor %}

Input

{{ response.filter.name }}

Output

Color

filter.field

Version 1.0

Returns the value of the field field of the filter.

{% for item in response.filters %}
{%
for item2 in item.values %}
<input type="checkbox" fltid='{{item2.id}}' flttype='{{item.field}}' {% if item2.id in activeFilter %} checked {% endif %} >
{% endfor %}
{% endfor %}

Input

{{ response.filter.field }}

Output

color

filter.selected_id

Version 1.0

Returns the value of the selected_id field of the filter.

{% set activeFilter item.selected_id|split(',') %}
<ul>
<li><a href="#" {% if item2.id in activeFilter %} class='active' {% endif %} >{{item2.name}}</a></li>
</ul>

Input

{{ response.filter.selected_id }}

Output

1,2,3

filter.values

Version 1.0

Returns the value of the values field of the filter.

{% for item in response.filters %}
{% for item2 in item.values %}
<label class="clearfix{% if item2.id in activeFilter %} active{% endif %}&quot; >
<input type="checkbox" fltid='{{item2.id}}' flttype='{{item.field}}' {% if item2.id in activeFilter %}checked{% endif %} >
<span>{{item2.name}}</span>
</label>
{% endfor %}
{% endfor %}

Input

{{ response.filter.values }}

Output

array (id, name)