I thought it may be handy to have a list of common template conditionals. This isn't a full list, just the most common ones I think must of need at times.
Display different code to guests and members.
Display code to user x.
Display to members only.
Display to guests only
Display if user has more than x posts (replace '>' with '<' for less than x posts).
Display to admins.
Display to mods.
Display in forum x.
Display in thread x.
That one isn't common as such but it could be handy, for example you could create a thread with forum rules and then edit the template thread_view with a special notice saying something like 'read carefully' to show in that thread only.
Like I said, that list isn't extensive but it's probably the most common conditionals used.
Display different code to guests and members.
Code:
<xen:if is="{$visitor.user_id}">
Code for Members
<xen:else />
Guests
</xen:if>
Display code to user x.
Code:
<xen:if is="{$visitor.user_id}==x">
Code for user x
</xen:if>
Display to members only.
Code:
<xen:if is="{$visitor.user_id}">
Code for members
</xen:if>
Display to guests only
Code:
<xen:if is="!{$visitor.user_id}">
Code for guests
</xen:if>
Display if user has more than x posts (replace '>' with '<' for less than x posts).
Code:
<xen:if is="{$visitor.message_count} > x">
Code for members with more/less than x posts
</xen:if>
Display to admins.
Code:
<xen:if is="{$visitor.is_admin}">
FOR ADMINS
</xen:if>
Display to mods.
Code:
<xen:if is="{$visitor.is_moderator}">
FOR MODS
</xen:if>
Display in forum x.
Code:
<xen:if is="{$forum.node_id}==x">
Code for forum x
</xen:if>
Display in thread x.
Code:
<xen:if is="{$thread.thread_id}==x">
Code for thread x
</xen:if>
That one isn't common as such but it could be handy, for example you could create a thread with forum rules and then edit the template thread_view with a special notice saying something like 'read carefully' to show in that thread only.
Like I said, that list isn't extensive but it's probably the most common conditionals used.