Skip to content

{exp:stash:context}

Mark Croxton edited this page Jun 21, 2013 · 3 revisions

Set the current context (namespace) for variables that you set/get. After setting the context, use the @ pointer to reference the namespace in your set/get code:

{exp:stash:context name="news"}

{!-- @ refers to the current context 'news' --}
{exp:stash:set name="title" context="@" type="snippet"}
My string
{/exp:stash:set}

{!-- now you can retrieve the variable in one of the following ways --}
{exp:stash:get name="title" context="@" type="snippet"}
{exp:stash:get name="title" context="news" type="snippet"}
{exp:stash:get name="@:title" type="snippet"}
{exp:stash:get name="news:title" type="snippet"}
{@:title}

Parameters

name = [ string ]

The name of your context (required)

Clone this wiki locally