Having some issues here, not sure if it's even possible.
Template one lists one entry. I want to set a variable and make its name the entry_id of that entry, to be used to validate on the next template based on the same entry.
Template two, I want to match a url segment to the variable. But i need to get the variable name from that same entry, so need to use the {entry_id} in the stash get tag.
I am getting funny results, where it only works if the {entry_id} tag apears anywhere inside the channel:entries loop. If i remove that single tag then the conidional always fails.
I am using EEv2.9.2 and Stash 2.5.8
My code:
Template One:
{exp:channel:entries channel="whitepapers" url_title="{segment_3}" limit="1" disable="categories|member_data|pagination" parse="inward"}
{exp:stash:set_value name="{entry_id}" value="{current_time format="%d%Y%g%i%s"}" scope="user" save="yes"}
{/exp:channel:entries}
Template Two:
{exp:channel:entries channel="whitepapers" url_title="{segment_3}" dynamic="no" limit="1" disable="categories|member_data|pagination" parse="inward"}
{exp:stash:parse process="end"}
{if "{segment_5}" == "{exp:stash:get name='{entry_id}'}"}
success
{/if}
{/exp:stash:parse}
{exp:stash:parse process="end"}
{if "{segment_5}" != "{exp:stash:get name='{entry_id}'}"}
fail
{/if}
{/exp:stash:parse}
{!-- ALWAYS FAIL'S UNLESS THE {entry_id} TAG APPEARS IN THIS CHANNEL ENTRIES LOOP ANYWHERE --}
{/exp:channel:entries}