It seems many users have issues with Stash and no_results
, but as far as I can tell, nobody is trying to do this scenario. Please forgive me if I missed something.
I would like to redirect users to a page if they stumble on the URL for a specific entry for which they do not have permissions, determined by some custom fields specified in {lv_permissions}
. To make permissions work, I needed to wrap the entries block in exp:stash:parse process="end"
, but that seems to have killed my {if no_results}{redirect="site/1"}{/if}
line. No redirect occurs, though the content also does not show up, which is good.
Does anyone have an explanation for this behavior and some proper syntax?
{lv_permissions}
{exp:stash:parse process="end"}
{exp:channel:entries
channel="my_channel"
require_entry="yes"
limit="1"
{stash:permissions}
}
{if no_results}{redirect="site/1"}{/if}
{/exp:channel:entries}
{/exp:stash:parse}
I tried the no_results_prefix
concept, but that doesn’t seem to work for exp:stash:parse
.