String

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.
stripStart
Strips a substring from the start of a string.
stripTags
Removes all Markdown syntax and HTML tags from a variable value. This function doesn't expect any parameters.
strlen
Returns the length of the given string. This function doesn't expect any parameters.
strtolower
Returns a string with all alphabetic characters converted to lowercase. This function doesn't expect any parameters.