What do I have to do to get files into the stash_templates-folder so I can use {stash:embed:test}.

I have been iterating through the new stash-docs over and over but I cant figure it out. Apart from that the new documentation is a great aprovement. Thanks for that!



You literally just have to put them there. :)

If you have a stash_templates/ directory already created then create your files in here with a regular .html extension. Stash will know where they are by what you tell it in your index:

$assign_to_config['stash_file_basepath'] = '/path/to/stash_templates/';

Then when you use the {stash:embed:test} tag it will look in that directory for 'test.html` and pull in whatever is in there.

If you want to split things up into sub-directories then that's fine too. You can just add the subdirectory into the call

  • Hm... You mean I put them there manually, like regular templates? There is no stash-tag to generate the files? I guess I'm missing the point whith the stash_templates.
    – David S
    Jun 29 '13 at 15:23
  • After having it sink in I think I can see the point. Thanks!
    – David S
    Jun 29 '13 at 16:04
  • It takes a while as it's a totally different mindset to regular EE templates but generally with Stash you keep things DRY and can take advantage of template inheritance. There are also fairly substantial performance benefits with caching and being able to split things up into template partials for re-use. Once you get your heard around it there's no going back :)
    – Ian
    Jun 29 '13 at 17:13

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.