So, I have a scenario where I'm setting a Stash variable based on a query string being passed. I'm using Mo' Variables to get the $_GET values.
// Query string: /?c1=74&c2=81
{exp:ifelse parse="inward" parse_tags="yes"}
{if get:c1}
{exp:stash:set name="active_cat" parse_tags="yes"}{get:c1}{/exp:stash:set}
{/if}
{if get:c2}
{exp:stash:set name="active_cat" parse_tags="yes"}{get:c2}{/exp:stash:set}
{/if}
{if get:c3}
{exp:stash:set name="active_cat" parse_tags="yes"}{get:c3}{/exp:stash:set}
{/if}
{if get:c4}
{exp:stash:set name="active_cat" parse_tags="yes"}{get:c4}{/exp:stash:set}
{/if}
{/exp:ifelse}
Works directly: {exp:stash:get name="c2" dynamic="yes"}<br> // outputs 81
Stash Variable works: {exp:stash:get name="active_cat" process="end"} // outputs 81
{exp:channel:entries
channel="{stash:_channel}"
category="{exp:stash:get name='active_cat' process='end'}"
dynamic="no"
orderby="title"
sort="asc"
limit="10"
parse="inward"
status="{stash:_status}"
disable="member_data|pagination"
}
<li><a href="{structure:page_url_for:{entry_id}}">{stash:_channel} - {stash:_status} - {title}</a></li>
{/exp:channel:entries}
Basically, it assigns a Stash variable 'active_cat' to c1, c2, etc. If a "c4" exists though, it overwrites that variable with the new value.
It works outside of the channel entries loop, but isn't being passed into the channel entries loop. This is in a Stash embed and there are 2 other variables passed into the loop correctly from the parent template.