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

If a user is in a group, don't run this script?

#1
So if I put in a template a script that I only want to run for every group except for one is there some <xen if> thing for that?

eg.
HTML:
<xen:if user not in group (group name/ID goes here)>
<script>
JQuery Script goes here
</script>
</xen>
Also, is there some place that lists all the possible xen:tag things?
Thanks.
 
F

Floris

Guest
#3
Here's my extra-debug-info script that helps designers and developers find the variables they need; [Product] XenFans.com - Extra Debug

Only for admins:
<xen:if is="{$visitor.is_admin}">

Only for mods:
<xen:if is="{$visitor.is_moderator}">

Only for registered members: (not guests)
<xen:if is="{$visitor.user_id}">

To make things "not", you can also 'compare against' and make it not with !
<xen:if is="{$visitor.user_id} != 1"> (if the user browsing, is NOT user_id 1)

Only if the member is in primary/secondary usergroup "5"
<xen:if is="{xen:helper ismemberof, $visitor, 5}">

To make things "not", you can prefix the conditional with ! (exclamation mark)
<xen:if is="!{xen:helper ismemberof, $visitor, 5}">

Resource: template conditionals discussion
http://xenfans.com/threads/guide-template-conditionals.44/