Overwrites the value saved on the given variable in the nearest scope. If the variable is not saved on any scopes, saves the value to the root scope. Optionally applies filters to the value before saving it.
{% set [name] = [value] [| filter1 [: arg [arg...]]] [| filter2 ...] %}
name: The name of the variable to save the value to. If name starts with '&', will attempt to assign the value by reference.
value: The value to assign to the new variable.
May optionally include one or more filters.
The set tag should ideally be used to update the value saved in a variable on a parent scope. It will only create a new varaible if the variable name provided has not been set on any available scope. This makes it ideal for use along with the var tag.
Set
Copy