Introduction

The default filter is used to provide a fallback value when a variable is null, empty, or undefined. This is useful to ensure there is always a value displayed, even if the original variable is not set.

Example of use

Example of how to use the default filter to define a fallback value when the first_name variable is not set or is empty:

{{ first_name|default('Name not defined') }}

Example Output Code