Speak to our experts today 0333 004 0333
Speak to one of our experts today
User Guides

EKM Tag: [ekm:filter_by]

This tag is used to output filtering controls for narrowing down a list of products. Product attributes are used to allow a customer to filter through all products on a category page.

Information Note

You will need to select attributes to be displayed on the filter_by from the “Edit Category” interface.

  • Tag Information
Basic Use
In it's basic use the tag will output any filterable options with the default HTML and CSS.

[ekm:filter_by][/ekm:filter_by]
								
Advanced Use
In it's advanced use you can specify your own surrounding HTML and CSS enabling you to fully customise how the filter_by tag looks.

[ekm:filter_by]
  target_tag_id='some-element-id';

  output_start='<div>';

  output_attribute_start='<h2>[name]</h2><ul>';
  output_attribute_item='<li>[input][name]</li>';
  output_attribute_end='</ul>';

  output_price='<h2>Price</h2>[min-input][max-input]';

  output_end='<button>Filter</button></div>';
[/ekm:filter_by]
								
Tag Attributes
Include Javascript
include_javascript='yes';

Define whether or not you wish to output Javascript to trigger the filtering of the showdata. ‘yes’ is the recommended setting but if you’d like to write your own javascript to do this you can disable the default actions.

Value
Description
yes
Recommended Default Javascript will be used
no
Javascript is disabled and the page will be forced to reload.
Include CSS
include_css='yes';

Define whether or not you would like the default styling to output with this tag. We recommend only writing modifier CSS and not actually turning off the CSS.

Value
Description
yes
Recommended Default CSS will be used
no
CSS is disabled and no styling will be output.
Include Price Widget
include_price_widget='yes';

Define whether or not the price filter widget will display on the filter list. Including this attribute will overwrite the setting in the edit category modal.

Value
Description
yes
Recommended Will output the product price widget.
no
The price filter widget will not be output.
Target Tag ID
target_tag_id='cat_products';

Define the showdata tag ID that will be filtered. If you do not use Javascript this attribute has no effect.

Value
Description
{user defined}
Define the ID of a showdata tag you wish to filter by.
Loading Image URL
loading_img_url='/ekmps/shops/username/resources/design/loading.gif';

The URL of the loading image that is displayed during filtering.

Value
Description
{user defined}
A path to an image.
auto
Outputs the default image.
Output Start
output_start='<div class="filter-by">';

Define any HTML you wish to be output before the filtering options. This will only output if there are filter options to output.

Value
Description
{user defined}
Define any opening HTML or Titles to go before the tag output.
Output Attribute Start
output_attribute_start='<div class="filter-by-attribute">';

Define any HTML or Text you want to output before the filter attributes. Here you should output the name of the attribute.

Value
Description
{user defined}
Define any opening HTML or Titles along with [name]
[name]
Outputs the name of the product attribute.
[key]
Outputs the key of the product attribute.
Output Attribute Item
output_attribute_item='<li>[input][name]</li>';

Define any HTML or Text you want to output after the filter attributes.

Value
Description
[name]
The filter option name.
[input]
A checkbox input for the filter option.
[input-name]
The value for the input's "name" attribute.
[input-value]
The value for the input's "value" attribute.
[input-checked]
If the input should start checked then outputs "checked" otherwise outputs an empty string.
Output Attribute End
output_attribute_end='</div>';

Define any HTML or Text you want to output after the filter attributes.

Value
Description
{user defined}
Define any opening HTML or Titles along with [name]
[name]
Outputs the name of the product attribute.
[key]
Outputs the key of the product attribute.
Output Price Filter
output_price='<h2>Price</h2>[min-input][max-input]';

Define how you would like to output the price filter.

Value
Description
[min-input]
The html input element for the minimum price value.
[max-input]
The html input element for the maximum price value.
[min-input-value]
The value for the minimum price input's "value" attribute.
[max-input-value]
The value for the maximum price input's "value" attribute.
[lower-limit]
The lowest price.
[upper-limit]
The largest price.
Output End
output_end='</div>';

Define any HTML you wish to be output after the filtering options.

Value
Description
{user defined}
Define any closing HTML to be displayed after the saving has output.
Change Callback
change_callback='doChange';

Define a javascript function in global scope to be called when the filter has changed.

Value
Description
{user defined}
Define a javascript function at global scope.
Request Start Callback
requeststart_callback='beginRequest';

Define a javascript function in global scope to be called when the filter has begun calling the new products.

Value
Description
{user defined}
Define a javascript function at global scope.
Request End Callback
requestend_callback='endRequest';

Define a javascript function in global scope to be called when the filter has finished calling the new products.

Value
Description
{user defined}
Define a javascript function at global scope.