EE 1
EE 2
Stash
Developer
3rd Party (Free)
Download v2.0.7
Compatibility
- LG Addon Updater
- Multi Site Manager
- Stand Alone Entry Form
Requirements
- jQuery for the Control Panel
Tags
Stash allows you to stash text and snippets of code for reuse throughout your templates.
Variables can be set dynamically from the GET or POST superglobals and can optionally be cached in the database for persistence across pages. You can even create snippets dynamically, and these will work just like EE’s snippets.
Variables that you create are available to templates embedded below the level at which you are using the tag, or later in the parse order of the current template.
As well as saving strings, Stash lets you create lists of variables (multidimensional arrays) and apply custom sorting/ordering and limits when retrieving them. Very handy for reusing Playa and Matrix row data.
You can also group individual variables into a ‘bundle’ for efficient saving and retrieval, which can be useful when working with form data.
By allowing you to re-use the rendered output of other tags, Stash allows you to respect the DRY principle and create highly efficient templates using the template partials concept. It also provides a convenient way to use pagination when using dynamic parameters.
For an excellent example of working with template partials see the second link below.
Simple example:
{exp:channel:entries limit="1" disable="member_data|pagination|categories"}
{exp:stash:set name="title"}{title}{/exp:stash:set}
{/exp:channel:entries}
{!--Now you can access like this in an embedded template or later in the parse order of the same template:--}
{exp:stash:get name="title"}
Pagination example:
{exp:stash:get name="my_form_field_name" type="snippet" dynamic="yes" cache="yes" refresh="30"}
In an embedded template we have a {exp:channel:entries} tag producing a paginated listing of entries:
{exp:channel:entries search:custom_field="{my_form_field_name}" disable="member_data|pagination|categories"}
...
{/exp:channel:entries}
Caching example
{exp:stash:set
name="my_cached_blog_entries"
save="yes"
scope="site"
parse_tags="yes"
replace="no"
refresh="60"
output="yes"
}
{exp:channel:entries channel="blog"}
{title}
{/exp:channel:entries}
{/exp:stash:set}
Download Stash
| EE Version | Downloads | Add-On Version | Release Date |
|---|---|---|---|
| 2.+ | Download | 2.0.7 | 2011-10-31 10:57 AM |
Stash Links
This entry was last updated February 2, 2012, 12:51 am.
Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. Devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!
7 Reviews:
ErikReagan 03.15.12
Stash is a top-notch add-on that helps make even more things easily possible within EE templates. It works in simple scenarios but also makes complex needs accessible with just 1 add-on. Love this add-on!
kroshnix 11.02.11
I had a crazy idea on how I’d execute a snippet of javacode and move it around back to the javascript itself. I really didn’t think there was a plugin who could solve it, but Stash was a perfect match!
Stefan Münch 10.13.11
Fantastic! With one tiny change it would suit a great deal of additional use cases: refresh = [int] being measured in SECONDS instead of minutes ...
Adam Khan 07.02.11
Stash does the most of any third-party add-on I know to make ExpressionEngine templates more of a programming environment. And Mark is dedicated to constantly improving it.
Amit 06.30.11
If you are looking for a dry approach using template partials, there is no beating stash. I have started using it with switchee and it works really well.
davidhyland 04.14.11
Simply brilliant!
John D Wells 03.05.11
A fantastic plugin to support the “partials” approach. Extra bonus points for building Switchee support (or visa versa I should say). Combined these are a powerful combo. Thanks Mark!