How do I properly make the sidebar display only for specific usergroups?


Well-known member
I have successfully added a sidebar Item to the thread_view for display when viewing threads and now was wondering what is the correct way to set the condition to display only if visitor is x,y,or z usergroupID

this is what I basically added


    <xen:include template="sidebar_xx_item" />

What kind of conditions and how can it be done is basically what I'm asking of anyone that can offer the help.


Well-known member
This works just fine...THANK YOU!

Is there something similar for a specific userID as brain is saying something like $user, 2 but I can't think of how to put that together.


Well-known member
The user ID is stored in the $visitor array, with the key: user_id.
So you can try...
Rich (BB code):
<xen:if is="{$visitor.user_id} == N">
    <!-- Stuff -->


Well-known member
Works just fine there sir! Note to anyone trying it...if you don't supply it with an actual userID and leave such as the example N upon saving xenforo will throw you back an error..don't fret just supply your user id ( I used 1 for admin ) and save and all should be fine.

Thanks again Shedab


Well-known member
You're welcome.

And yes, "N" is to be replaced with either an integer or a variable containing an integer;
to work correctly.


Formerly Tilkißey
Hey while I got yah with all the answers here :), is there a similar snippit I could use for forumID ?
u can use for forumIDs this code, an example in thread_view template ( i use in that )
<xen:if is="in_array({$forum.node_id}, array(5,7,8,9,26))">
u can edit this code for ur main target
<xen:if is="in_array({$visitor.user_id}, array(1,2,3,54,645645))">
via using this codes, u will add less codes, not code crowding (sorry my English =) )