Miscellaneous filters for various operations in Liquid templates.
default
default
will show its value if the left side is falsy or empty (string
or Array
).
In this example, product_price
is not defined, so the default value is used.
product_price
is defined, so the default value is not used.
product_price
is empty, so the default value is used.
false
false
instead of the default value, you can use the allow_false
parameter.
json
JSON.stringify()
, for debug purpose.
parse_json
nil
.
space
parameter can be specified to format the JSON.
jsonify
inspect
json
, but inspect
allows cyclic structure. For the scope below:
space
argument can be specified for the indent width.
to_integer