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

XF 1.3 Conditional for 'if member isn't in this usergroup'?

Discussion in 'Styling and Customization Questions' started by Liam W, Mar 23, 2014.

  1. Liam W

    Liam W Well-Known Member

    Is there a template variable for the usergroups a member is in? I want to show ads to everyone except members of this usergroup...

    Liam
     
  2. HWS

    HWS Well-Known Member

    Code:
    <xen:if is="!{xen:helper ismemberof, $visitor, X}">
    
    CONTENT
    
    </xen:if>
    Replace X with your user group and CONTENT with your content.
     
    Liam W likes this.
  3. Brogan

    Brogan XenForo Moderator Staff Member

  4. Liam W

    Liam W Well-Known Member

    Ah yes, I remember now :)

    Thanks @HWS and @Brogan :)

    Liam
     
  5. reohh

    reohh Member

    Create a custom template and put this code in:
    Code:
    <xen:if is="{$visitor.user_group_id} != 3">
        <div style="text-align: center;  padding: 7px;">
    <!--INSERT ADSENSE CODE HERE -->
    </div>
    </xen:if>
    This will show the ad for anyone not in usergroup 3

    Now in your PAGE_CONTAINER or wherever you want the ad to appear insert this code:

    Code:
    <xen:include template="NAME_Of_CUSTOM_AD_TEMPLATE" />
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    No need to use custom templates.
    There are ad_ templates built in.
     
    Liam W likes this.

Share This Page