croxton / Stash

Stash allows you to stash text and snippets of code for reuse throughout your templates.
GNU General Public License v3.0
198 stars 20 forks source link

Disabling caching during development #177

Closed roberthallatt closed 1 year ago

roberthallatt commented 1 year ago

What is the best way to disable caching in a development environment so that I can use a build script?

croxton commented 1 year ago

Some options described here: https://devot-ee.com/add-ons/support/stash/viewthread/16293#53433

roberthallatt commented 1 year ago

I am using this pattern - https://github.com/croxton/Stash/wiki/Stash-template-inheritance but for some reason, no matter what I try, I can't get the cached variables to update while working on the site in development.

roberthallatt commented 1 year ago

I have this in my template

{exp:stash:extend name="block:primaryhero" with="partials:pages:home:hero-option1"}

And this in my wrapper

{exp:stash:block:primaryhero}{/exp:stash:block:primaryhero}

I'm running EE v. 7.2.7

croxton commented 1 year ago

I think you can do:

{exp:stash:extend name="block:primaryhero" with="partials:pages:home:hero-option1" replace="{global:stash_replace}"}

Where global:stash_replace is a variable you have set in your environment config ("yes" for local dev).

roberthallatt commented 1 year ago

Ok, there was a really silly typo on my part so finally have this working now.