XF 2.1 Customfields with <xen:if - Problem

Hoerspiel

Member
Hi guys, actually i have no idea, i want to hardcode customize my postbit. I have it done in the past with XF 1.5, but its not working with XF2.1.

I have a custom field, in which the users are put an URL, and in the postbit i want that url to be shown and clickable, but only if the user has put in a url.

I know, i can do this right in the acp with the standard xenforo functions, but i want to style it differently.

Thats the way it worked in XF 1.5 (speciallink is the id for the customfield):

Code:
    <xen:if is="{$user.customFields.speciallink}">
        <a href="{$user.customFields.speciallink}" target="_blank">
            <center><b>LINK</b></center>
        </a>
    </xen:if>

So now i found the new way to get customfields in the template, its this one:

Code:
<a href="{$user.Profile.custom_fields.speciallink}" rel="nofollow">LINK</a>

But i want it just to be shown, if the user have write something in the customfield. So i have tried this:

Code:
<xen:if is="{$user.Profile.custom_fields.speciallink}">
        <a href="{$user.Profile.custom_fields.speciallink}" rel="nofollow">LINK</a>
</xen:if>

Anyone have solution, for that and now, how to get it right? May be i have a just stupid error?
 
Last edited:
Top Bottom