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

Custom Field

Discussion in 'Styling and Customization Questions' started by Dynamic, Jun 28, 2012.

  1. Dynamic

    Dynamic Well-Known Member

    Hi there,

    Is it possible to make a custom URL field appear only if the user has filled it in?

    I have this code in everyones signature.

    <a href="{$message.customFields.testsig}" rel="nofollow">View my blog</a>

    In their signature, it displays the text "View my blog". I would like it so it will only display the text in the signature if people have filled in the custom user field. Can anyone help me with this?

    Thanks.
     
  2. MagnusB

    MagnusB Well-Known Member

    Code:
    <xen:if is="{$message.customFields.testsig}">
    <a href="{$message.customFields.testsig}" rel="nofollow">View my blog</a>
    </xen:if>
     
  3. Dynamic

    Dynamic Well-Known Member

    Hi there,

    I tried that, but all that done was allowed people who had the field filled out to view it and those who had not could not. So if user a filled it out, he can still see the link "view my blog" on everyones sig, even if they have not filled the information in. It links back to the defualt url.

    I would like a way so if it is not filled out, it will not show on the users sig.

    Thanks.
     
  4. MagnusB

    MagnusB Well-Known Member

    I am not sure if I follow you. That is the exact same code I am using on my site for similar purposes, and it is working as expected. I am using a checkbox to enable it though.

    You are saying that if a user has the field in, the signature shows on everyone's post?
     
  5. Dynamic

    Dynamic Well-Known Member

    Sorry, I did something wrong. It is working now.

    I do have one more question though. In the message template, it is calling in the template. If a user has not filled out a field, it shows a little box. Is it possible to put an if statement there, so if a user has filled out any of the custom fields it will display, but if they have not filled out any of the custom fields it will just show up nothing?

    Thanks.
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  7. Dynamic

    Dynamic Well-Known Member

    Perfect. Thanks dude!
     

Share This Page