How can I use a stash variable that has been stored up in the template as a value for an embed parameter further down?

{embed="template/_include" email="{exp:stash:get name="email"}"}

Obviously at the moment I am hitting some parse issues but I don't know how to rectify.


If you must use an EE embed rather than a Stash embed, then the easiest approach would be to set a global ("snippet") variable rather than a Stash variable:

{exp:stash:set name="email" type="global"}My email address{/exp:stash:set}

Than reference it in your embed template like so


Alternatively, use a Stash embed:

{exp:stash:set name="email"}My email address{/exp:stash:set}


Then reference the variable in the Stash embed like so:

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.