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

XF 1.3 Hide elements if visitor is in a group

Discussion in 'XenForo Questions and Support' started by Onidra, Mar 8, 2014.

  1. Onidra

    Onidra Member

    Hi,

    I have 2 elements (ads) to hide if my visitor is logged and if he's in a special group (number 19). But I can't find how to do it.
    • Hide a widget. I have found XenForo_Template_Helper_Core::callHelper('ismemberof', array($visitor,19)). But, I want to show the widget to everybody, except for members in the group.
    • Hide some content in template. I would hide a banner in my header template. How can i put in xenforo style :
    PHP:
    <?php if($utilisateur=>group !=3)
    echo 
    'Show my ads';
    ?>
    Thanks for the help..
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Assuming you are editing a template, use a user group conditional statement.

    <xen:if is="!{xen:helper ismemberof, $visitor, x}">
     
  3. Onidra

    Onidra Member

    Thanks @Brogan. It's working for template.


    But for a widget ? How can I change the code to add in "Expression" to hide only for a group ?
     

    Attached Files:

  4. Brogan

    Brogan XenForo Moderator Staff Member

    If by widget you mean something to do with an add-on, you will need to ask in the add-on thread.
     

Share This Page