I’m building a system where entries should have specific member access.
I have a parent template that checks member group which then embeds a template specific to this and then lists entries which should only display if the current member ID matches the specified entry ID. Problem is using the ‘member_id’ or ‘logged_in_member_id’ won’t work.
I’ve tried a number of ways to do this but none work.
Firstly I’ve tried directly:
{if '{pref_member_access}' == '{member_id}/{logged_in_member_id'}
do a thing
{/if}
Next I tried embedding the id:
{if '{pref_member_access}' == '{embed:mem_id}'}
do a thing
{/if}
with parent:
{embed="_page/.pref_list" mem_id="{member_id}/{logged_in_member_id}"}
and also I’ve tried with stash:
{exp:stash:set name="mem_id"}{member_id}/{logged_in_member_id}{/exp:stash:set}
These will all work and give me the correct output inside the embeded template but NOT if I try to use the output inside the conditional.
Just to clarify I am not using ‘{member_id}/{logged_in_member_id}’ as I have put it in the code above, I have used either/or
If I specify a member ID the conditional will work:
{embed="_page/.pref_list" mem_id="8"}
or
{exp:stash:set name="mem_id"}8{/exp:stash:set}
for example
even if I try to ‘stash’ the member ID at my master template it won’t work as a dynamic value either.
(you can probably ignore the stash code if you are unfamiliar with it, this isn’t really regarding that, I’m just trying to use the current logged in members ID as a dynamic value)
Any ideas?
Thanks