Last updated: 2020-11-16
Source: https://support.freshservice.com/support/solutions/articles/50000003067-helpers
Default Helpers
length
Returns the length of the given string or array.
Params
default
Returns the first value that is not undefined, otherwise the "default" value is returned.
Params
eq
Block helper that renders a block if a is equal to b. If an inverse block is specified it will be rendered when falsy. You may optionally use the compare="" hash argument for the second value.
Params
gt
Block helper that renders a block if a is greater than b.
If an inverse block is specified it will be rendered when falsy. You may optionally use the compare="" hash argument for the second value.
Params
lt
Block helper that renders a block if a is less than b.
If an inverse block is specified it will be rendered when falsy. You may optionally use the compare="" hash argument for the second value.
Params
lte
Block helper that renders a block if a is less than or equal to b.
If an inverse block is specified it will be rendered when falsy. You may optionally use the compare="" hash argument for the second value.
Params
gte
Block helper that renders a block if a is greater than or equal to b.
If an inverse block is specified it will be rendered when falsy. You may optionally use the compare="" hash argument for the second value.
Params
ternary
Returns either of the two values provided based on the condition given.
Params
isnt
Block helper that renders a block if a is not equal to b. If an inverse block is specified it will be rendered when falsy.
Params
not
Returns true if val is falsey. Works as a block or inline helper.
Params
or
Block helper that renders a block if any of the given values is truthy. If an inverse block is specified it will be rendered when falsy.
Params
and
Helper that renders the block if both of the given values are truthy. If an inverse block is specified it will be rendered when falsy. Works as a block helper, inline helper or subexpression.
Params
startsWith
Block helper which tests whether a string begins with the given prefix and render as if and else.
Params
ellipsis
Truncates a string to the specified length, and appends it with an elipsis, (…).
Params
replace
Replace all occurrences of substring a with substring b.
Params
lowercase
Lowercase all characters in the given string.
Params
uppercase
Uppercase all of the characters in the given string. If used as a block helper it will uppercase the entire block. This helper does not support inverse blocks.
Params
titleize
Title case the given string. From “this is sample text” to “This Is Sample Text”
Params
isEmpty
Inline, subexpression, or block helper that returns true (or the block) if the given collection is empty, or false (or the inverse block, if supplied) if the collection is not empty.
Params
isObject
Return true if value is an object.
Params
isNumber
Return true if value is an object.
Params