default - Liquid Tag Reference - 0.11.4

Tag Name default
Version 0.11.4

Description

Define default values for template variables.

Examples

You can define a default value for the variables used in your template. If no value is supplied for them when the template is rendered, the default value will be used.

{% default who: 'Mary', what: "lamb" %}
{{ who }} had a little {{ what }}.
Mary had a little lamb.

When variables are supplied, they will be used instead of the default value.

who: "Tarzan"
what: "chimp"
{% default who: 'Mary', what: "lamb" %}
{{ who }} had a little {{ what }}.
Tarzan had a little chimp.

Back to Tag List

Back to Liquid Reference for 0.11.4

 

 
Back to Documentation