Liquid
How to Format Rules with Liquid Templates.
Last updated
Was this helpful?
How to Format Rules with Liquid Templates.
Last updated
Was this helpful?
You can use liquid templates using the following syntax:
The liquid syntax is documented by Shopify at .
Squidex provides special extensions.
Resolves a content by ID and saves the content as a variable.
Resolves an asset by ID and saves the asset as a variable.
Formats a date using a specified pattern.
Returns the number of milliseconds between 1970/1/1 and a given date.
Returns the number of seconds between 1970/1/1 and a given date.
Escapes a value to be a valid JSON string.
Converts a HTML string to plain text.
Converts a Markdown string to plain text.
Calculates the MD5 hash from a given string. Use this method for hashing passwords, when backwards compatibility is important
Calculates the SHA256 hash from a given string. Use this method for hashing passwords.
Calculates the slug of a text by removing all special characters and white spaces to create a friendly term that can be used for SEO-friendly URLs.
The template engine is not aware what kind of content you create. Therefore it cannot be optimized for JSON or other formats. If you inject strings into a JSON object or array you have to ensure that the value a valid JSON string.
The solution is to use the escape
filter for string fields:
You can omit the filter for fields that follow a specific format, as for the date
field above.
The same as . Removes all white space (tabs, spaces, and newlines) from both the left and right sides of a string. This does not affect spaces between words.