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

XF 1.3 If statement with multiple usergroups

#1
I'm trying to figure out the conditional statements behind showing an item based on if people are not part of a particular usergroup.

In other words:

<if usergroup != "this group">

Show script

</end if>

Guessing it's really easy, but haven't been able to dig it out via search? :confused:
 
#4
Still having an issue

I'm Using:

<xen:if is="!{xen:helper ismemberof, $visitor, 3}">
Output text
</xen:if>

Which Gives me:

Template Errors:
  1. Argument 1 passed to XenForo_Template_Helper_Core::helperIsMemberOf() must be an array, null given in /httpdocs/test-forum/library/XenForo/Template/Helper/Core.php
  2. Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be an array, null given, called in /httpdocs/test-forum/library/XenForo/Template/Helper/Core.php and defined in /httpdocs/test-forum/library/XenForo/Model/User.php
I'm testing it out using the id 3 (the administrator ID), which I found using this method:
http://xenforo.com/community/threads/user-group-id-numbers.39262/
 
#6
Where are you entering the conditional statement and script code?
Hi Brogan, thank you for taking the time. In this particular case I'm entering the conditional statement in inside the "template modification" editor, and that's resulting in the error posted above.
 

Brogan

XenForo moderator
Staff member
#10
Can you copy and past everything in the Replace field.
Some of it is truncated so I want to make sure I use the same.

Have you used $0 at the start of the Replace field to insert the content?