Skip to documentation content

Filters Overview

Filters Overview

Filter syntax, parameters, and chaining for modifying object output.

Filters may be used to modify objects before either being stored in a variable or output to the template. There are also some methods which allow the use of filters to modify an input object before it is evaluated by the method.

The syntax for using a filter is "input | filter_name: comma_separated_filter_parameters". For example: {{request.date | time_diff:entity.post_date, 'd'}}. Not all filters require parameters, in which case only the filter name is required. For example: {% var show_buttons = request.query_params['show_buttons'] | to_boolean %}.

Multiple filters may be chained together for more complex functionality. For example: {% var one_rooms = houses | where: "rooms", "1" | sort: "price" %}.