Documentation
Community
GitHub
Try a Demo
stripStart
String
Strips a substring from the start of a string.
@{ variable | stripStart (start) }
Parameters
start
The substring to be stripped from the start of a variable value.
stripEnd
stripTags
dateFormat
Formats a date variable using a specified format string. The format string must be a valid DateTime format. Month and weekday names are automatically translated based on a given locale. To reference the current date, use the :now variable.
def
Returns a given default value for a variable in case the variable is not defined or empty.
escape
Escapes a string to be safely used in JSON formatted data or similar. This function doesn't expect any parameters.
findFirstImage
Finds the first img tag in a rendered HTML string and returns the src attribute. This function can be used to extract the first image form a block variable to be used separately in any other place like a teaser section of a page card in a pagelist.
findFirstParagraph
Finds the first paragraph tag in a rendered HTML string and returns its content. This function can be used to extract the first text block form a block variable to be used separately as a teaser text for the page in a pagelist.
sanitize
Sanitizes a string for use in URLs or HTML attributes. The resulting string contains only lowercase letters a-z, numbers 0-9, hyphens -, and optionally dots .. This method is also suitable for filenames, as it preserves dots as file extension separators by default.
shorten
Shortens a string to a given number of characters and appends an optional ellipsis, without cutting off words. To avoid open or incomplete HTML tags, all tags will be removed before shortening a string.
stripEnd
Strips a substring from the end of a string.