Text

Format and transform text in Easol themes.

Text filters help you format strings for display, URLs, and natural language.

Create URL-friendly strings

Use parameterize to convert a string into a URL-friendly format.

Special characters are removed, whitespace is replaced with hyphens (-), and the result is converted to lowercase.

{{ "Music Festival" | parameterize }}

This renders:

music-festival

This filter is useful when generating slugs or URL parameters from user-provided content.

Singular and plural words

Use pluralize to output the correct singular or plural form of a word based on a number.

{{ item_count }} {{ item_count | pluralize: "item" }} in your cart

If item_count is 2, this renders:

2 items in your cart

You can also provide a custom plural form.

{{ people_count }} {{ people_count | pluralize: "person", "users" }} in your venue

If people_count is 2, this renders:

2 users in your venue

Join a list into a sentence

Use to_sentence to convert an array of strings into a human-readable sentence.

For example, given products named Adult, Teen, and Child:

{{ products | map: "name" | to_sentence | append: "Tickets" }}

This renders:

Adult, Teen and Child Tickets

This filter is particularly useful when displaying lists of product names, destinations, activities, or categories.

Choosing the right filter

FilterUse when
parameterizeConvert a string into a URL-friendly slug.
pluralizeDisplay the correct singular or plural word based on a number.
to_sentenceConvert an array of strings into a readable sentence.

On this page