We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

{exp:member:has_role} is not working as expected

Development and Programming

studionigh's avatar
studionigh
17 posts
2 years ago
studionigh's avatar studionigh

I have a members only area that I am setting up on a site. As part of the navigation, I would like parts of navigation to appear for users that are part of a certain role. I have the role of “partner” as “18”. I am using the members “has_role” function to show and hide the navigation. I am adding a pipe to this tag to also have super_admin see the navigation.

{exp:member:has_role role_id="1|18"}
<a href="http://this">partners</a>
{/exp:member:has_role}

Here is the interesting thing. When I login as “super_admin” (1), I see the navigation. When I login as a “partner” (18), I do not see the navigation. When I delete the “1” from the tag, then the “partner” can see the navigation, but of course “super_admin” does not see it. Are pipes not allowed in this tag? Are there other settings that I need to look at?

Thanks for any help!!

Patrick

       
Rob Allen's avatar
Rob Allen
3,105 posts
2 years ago
Rob Allen's avatar Rob Allen

I don’t think has_role can accept piped ID’s. If you want super admins to see the links I suggest duplicating the tag, one for each role.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.