Skip to content

Short tag syntax

Mark Croxton edited this page Dec 13, 2016 · 5 revisions

The following shorter syntax may be used with ExpressionEngine 2.5+.

{exp:stash:your_var_name} or {exp:stash:your_context:your_var_name}

When used as a single tag, this is equivalent to {exp:stash:get name="your_var_name"}. When used as a tag pair, this is equivalent to {exp:stash:set name="your_var_name"}Hello World{/exp:stash:set}.

{stash:embed:your_template} or {stash:embed:your_context:your_template}

Alternative syntax for stash embeds.

Important:

ExpressionEngine will choke if you use the same tag as a single and as a pair in the same template:

{exp:stash:test process="end"}

{exp:stash:test}Test value{/exp:stash:test}

If you use the short tag syntax for both setting and getting variables, make sure to get a variable in a different template than the one you set it in.

Clone this wiki locally