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

Custom User Field (Specific Group)

Discussion in 'XenForo Questions and Support' started by Stimo, Aug 30, 2012.

  1. Stimo

    Stimo Active Member

    Hi guys, is there a way to allow it so only members of a certain usergroup can access a specific custom user field?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  3. Stimo

    Stimo Active Member

  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That code example checks admin status. But you can do a group check like this:

    Code:
    											<xen:if is="{$field.field_id} != 'field_id of restricted field' OR {xen:helper ismemberof, $visitor, 4}">
    												<xen:include template="custom_field_view" />
    											</xen:if>
    
     
  5. Stimo

    Stimo Active Member

    Just wondering.. does this stop the group from seeing the custom field when viewing a users profile? As that is not what I want.. I want it so that only a specific group can choose an option in the custom field but i want everyone to see it when viewing users profile
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Stimo likes this.
  7. Stimo

    Stimo Active Member

  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You are missing a </xen:if>
     
    Shelley likes this.
  9. Stimo

    Stimo Active Member

    Excellent, its fully working! Thank you Sir!
     

Share This Page