Guest Nav

Post

Posted
Rating:
#3361 (In Topic #628)
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’

How to display menu items to guests and not members

The documentation states to use {$?,{$IS_GUEST},_never_} to display a menu item to a member but not a guest.

I want to do the exact opposite – display a link to guests but not a member

I've tried a few variations below but none work:

{$?,{$NOT,{$IS_GUEST}},_never_} | {$?,{$NOT,{$IS_GUEST},_never_}}

I also can't find any documentation on _never_ or alternative options to use in that inline IF test.

I tried using {$?,{$IS_GUEST}},_always_}, but this doesn't show for members or guests, so I imagine _always_ doesn't exist.
Online now: No Back to the top

Post

Posted
Rating:
#3362
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
{$?,{$NOT,{$IS_GUEST}},_never_} should actually work.
I'll run some tests when I get a chance.

This technique is a fudge. There's no such thing as "_never_". What is actually happening is the conditional logic is outputting a match-key that will never pass (_never_).


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#3364
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
Sorry Chris, but it seems to be working now. Maybe I misspelled something when I tried it!

Thanks!
Online now: No Back to the top
1 guest and 0 members have just viewed this.
Back to Top