1

Since upgrading to EE 2.9.0 and Stash 2.5.6 I am having problems with stash snippets.

I am getting results such as %Y-%m-%dT%H:%i:%s%Q

{exp:stash:set_value name="my_var" type="snippet" value="oof"}

{exp:stash:get name="my_var" type="snippet"}

works fine and prints oof, but

{my_var} prints {my_var}

I have been using the second method extensively through my site in conditionals or simply to display elements.

Thanks

2

Stash variables set to type="snippet" can be accessed in the same way as in previous versions of EE. To demonstrate:

{embed="inc/snippet_embed"}
{exp:stash:set name="my_snippet" type="snippet"}My snippet{/exp:stash:set}

The template inc/snippet_embed looks like this:

{my_snippet}
<br>
{if my_snippet} My snippet has a value!{/if}

Output:

My snippet 
<br>
My snippet has a value!

Conditionals in EE 2.9 have of course changed which does have some implications when evaluating Stash snippet variables, which you can read about here:

https://gist.github.com/croxton/9d012297096892ca5c10

| 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.