Is it possible to Stash some content in one template and then grab it from another template?
Basically, I want to store a bunch of Entry IDs in one template and then i'm AJAX loading another template where I would like to retrieve those Entry IDs and use them to plot markers on a map.
I've tried using scope, but it doesn't appear to be working.
{exp:stash:set name="show_nearby" parse_tags="yes" parse_depth="2" parse="inward" trim="yes" scope="user" refresh="10"}
{exp:channel:entries dynamic="no" url_title="{segment_4}"}
{exp:trails_nearby entry_id="{entry_id}" lat="{thingtodo_latitude}" lng="{thingtodo_longitude}"}
{/exp:channel:entries}
{/exp:stash:set}
The following code gets the values above when used in the same template (so I know the values are being set;
{exp:stash:get name="show_nearby" backspace="1"}
However, when I use in another template it just returns everything from the channel because the entry_id isn't being set;
{exp:channel:entries channel="things-to-do" entry_id="{exp:stash:get name='show_nearby' backspace='1' scope='user'}" parse="inward" status="open" dynamic="no"}
{title}
{/exp:channel:entries}
I would appreciate any advice.
Thank you.
{exp:stash:set...}
is working without AJAX, I'd assume your JS isn't. When you say 'returns everything' I assume your filters aren't being applied, can you debug the POST data and share that as well? – adamellsworth Jan 14 '14 at 16:51