XF 1.1 Conditional woes - Display specific user(s) in sidebar


Well-known member
I have the following code here (which is added to sidebar_online_users) template. What it should do is to display an user with user ID 3 regardless of his status (online/offline).

<!-- block: sidebar_special_users -->
    <div class="section staffOnline avatarList">
        <div class="secondaryContent">
                        <xen:if is="{$user.user_id} == 3">
                                <xen:avatar user="$user" size="s" img="true" />
                                <xen:username user="$user" rich="true" />
                                <div class="userTitle">{xen:helper userTitle, $user}</div>
<!-- end block: sidebar_special_users -->

For some reason, it is not working. I asume it is because I am using wrong conditional, but if I try <xen:if is="{$visitor.user_id} == 3"> it doesn't work either. I suppose there must be something I forgot, so any help is highly appreciated.


XenForo moderator
Staff member
Just hard code it into the template, for example:
<a href="{xen:link 'members/member.3/'}" class="avatar Av1m" data-avatarhtml="true"><img src="data/avatars/m/0/3.jpg" width="96" height="96" alt="Member" /></a>

That code is something I use on my site, so just adapt it to suit your requirments.