I've written a custom plugin which I call repeatedly (via a channel:entries tag) to store a list of entries in an array. (BTW, you have to set up a separate singleton class to do that, as the plug-in object gets re-instantiated from scratch every time it's called from the template.) So the plug-in has two functions: one to store the entry ID's (parse_home_seq), and one to return the entry we're currently looking for (get_hero), which is dictated by the value of a cookie.
I've logged extensively in the plug-in, so I know that it's returning the right ID. And yet, the second channel:entries tag always returns the same entry (while the get_hero function cycles through the entries on successive page requests). I've been banging my head against this wall all day. Here's the code:
{!-- Determine which products to use for hero --}
{exp:channel:entries channel="products" status="wide" orderby="homepage_seq_no" sort="asc"}
{exp:ah_proc:parse_home_seq seq="{homepage_seq_no}" id="{entry_id}"}
{/exp:channel:entries}
{exp:stash:parse process="end"}
{exp:ah_proc:get_hero no_update="1"}:: {!-- for logging --}
{exp:channel:entries channel="products" entry_id="{exp:ah_proc:get_hero}" status="wide" limit="1" parse="inward"}
{entry_id} {!-- for logging --}
<h1>{title}</h1>
{/exp:channel:entries}
{/exp:stash:parse}
Any help appreciated. Thank you.