filter_default (zotonic_mod_base v1.0.0-rc.17)

Provide an alternative value in case a value has a falsy value (0, false, undefined or empty string).

For example:

{{ value|default:1 }}

This filter is built-in in the template compiler and inlined when compiling templates.

See also

default_if_none, if, is_defined, is_undefined, if_undefined

Summary

Functions

default(V, Default, Context)