Filters

Filters are used to modify the output of numbers, strings, variables and objects. They are placed within an output tag {{ }} and are denoted by a pipe character |.

Input

<!-- item.title = "Toaster Inc has a new factory" -->
{{ product.title | upcase }}

Output

TOASTER INC HAS A NEW FACTORY

In the example above, item is the object, title is its attribute, and upcase is the filter being applied.

Some filters require a parameter to be passed.

Input

{{ "/my/fancy/url" | append: ".html" }}

Output

/my/fancy/url.html

Multiple filters can be used on one output. They are applied from left to right.

Input

{{ "adam!" | capitalize | prepend: "Hello " }}

Output

Hello Adam!

Got an issue? Or want to submit feedback?
Submit your feedback

Our new Feedback and Issue Tracker is built on GitHub Issues. Just leave your comment below and you can track our team resolve it, or browse issues others have already submitted.

Read how to use the Feedback and Issue Tracker