• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

If usergroup=x display y in sidebar

#1
How easy is it to have a snippet of code in the sidebar that displays a message to people in a certain usergroup, possibly a

"upgrade your membership to ....." if usergroup = regsitered normal, sort of thing
 

borbole

Well-known member
#2
How easy is it to have a snippet of code in the sidebar that displays a message to people in a certain usergroup, possibly a

"upgrade your membership to ....." if usergroup = regsitered normal, sort of thing
Try something like this:

Code:
<xen:if is="{$visitor.user_group_id} == x">
<!-- Your message here -->
</xen:if>
And replace x with the usergroup that you want to show your message.
 
F

Floris

Guest
#3
^ that only works if the user is in the primary usergroup.
If their account upgrade sets them to secondary (which it will) the msg will still show

Code:
<xen:if is="{xen:helper ismemberof, $visitor, 5}">
The user browsing is in either primary/secondary usergroup with id 5.
</xen:if>
 

borbole

Well-known member
#4
^ that only works if the user is in the primary usergroup.
If their account upgrade sets them to secondary (which it will) the msg will still show

Code:
<xen:if is="{xen:helper ismemberof, $visitor, 5}">
The user browsing is in either primary/secondary usergroup with id 5.
</xen:if>
I assumed that the OP wanted to show the message to the primary usergroup. But now he has both options :)