0

Since I need bits and pieces of a channel entry on various parts of my page, is it possible to store the channel entry in one big variable that contains everything? That way, I can access it throughout the template (and embedded templates)?

I've used Stash for variables, usually for one field value only. Now I want the entire channel entry - all the fields.

1 Answer 1

3

You can use Stash for this as well. Just create a variable for each value from the channel entry that you want to use.

It seems like you want a less manual process, but there isn't a default EE way of doing that. You probably could build a third party add-on to do something like this, but there aren't any that I know of that have this functionality.

5
  • The "each value from the channel entry" is the approach I want to avoid. Tough. Feb 5, 2013 at 20:32
  • You don't have to do it for each custom field. Just set a stash variable that has all the custom fields and html in one chunk (wrap it all with stash:set).
    – Alex Kendrick
    Feb 5, 2013 at 20:33
  • No, I don't want mark up. I want to be able to access the individual pieces of information so I can use it throughout the page. Feb 5, 2013 at 20:36
  • In that case, go with Trevor's suggestion. Or as others have mentioned elsewhere, Global Variables (or Low Variables or Republic Variables) are a good way to handle this scenario instead of a Channel entry.
    – Alex Kendrick
    Feb 5, 2013 at 21:01
  • You could probably build a custom add-on that loads the channel module and then work in the functionality that you need, but I don't know if that is worth the time it would take. Feb 5, 2013 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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