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

How to show content of a user only if they have filled out a custom user field

Discussion in 'XenForo Development Discussions' started by Matthew Hawley, Dec 15, 2013.

  1. Matthew Hawley

    Matthew Hawley Well-Known Member

    ThSo I made this addon that pulls a user's github repos and puts it in a profile tab. Only problem is that if a user hasn't filled in the custom user field it doesn't look right.

    Don't tell me to do this:
    Code:
    <xen:if is="{$visitor.customFields.field_id}">
    
    </xen:if>
    That only shows content to a user if they have filled in a custom user field. It doesn't show content of a user if they have filled in a custom user field.
     
    Last edited: Dec 15, 2013
  2. Chris D

    Chris D XenForo Developer Staff Member

    Use

    Code:
    <xen:if is="{$user.customFields.field_id}">
    
    </xen:if>
     
    Matthew Hawley likes this.
  3. Matthew Hawley

    Matthew Hawley Well-Known Member

    Thanks! The answer was right in front of me...:oops:
     

Share This Page