XF 2.0 Custom user fields variable

Tealk

Well-known member
Hi,
how i write this variable in xf2?
Code:
<dt>{xen:helper userFieldTitle, arma_guid}:</dt>
<dd>{$user.customFields.arma_guid}</dd>
 
Hi

I have a dropdown menu on custom userfield. How can I convert below code for it. I am trying to show icon according to chosen user custom field. When I add below code for each custom field value all icons are appear on message user info whether or not they are selected.

Code:
<xf:if is="{$user.Profile.custom_fields.study_area.master}">
<a href="/Forum/pages/gorev_tanim/?type=master" target="blank_" rel="nofollow"><img class="Tooltip" src="/styles/default/logo/logo_sidebar.png" alt="{$user.Profile.custom_fields.study_area.master}" width="40" height="40" title="Master"/></a>
</xf:if>
<xf:if is="{$user.Profile.custom_fields.study_area.beginner}">
<a href="/Forum/pages/gorev_tanim/?type=beginner" target="blank_" rel="nofollow"><img class="Tooltip" src="/styles/default/logo/logo_sidebar.png" alt="{$user.Profile.custom_fields.study_area.beginner}" width="40" height="40" title="Master"/></a>
</xf:if>
 
Last edited:
I have been using custom user fields on my forum. I am trying to show icons in member user info according to selected custom user field. All of this actually :)

I made it xenforo 1.x with below code but I couldnt convert it for xf2

Code:
<xen:if is="{$user.customFields.calisma_gruplari.ust_yonetim}">
<dt><a href="/Forum/pages/gorev_tanim/?type=ust_yonetim" target="blank_" rel="nofollow"><img class="Tooltip" src="/Forum/styles/gorev/ust_yonetim.png" alt="{$user.customFields.calisma_gruplari.ust_yonetim}" width="40" height="40" title="Üst Yönetim"/></a></dt>
</xen:if>

1540808504442.webp
 
I made it xenforo 1.x with below code but I couldnt convert it for xf2
You could try that once, but you didn't test it.
HTML:
<xf:if is="{ $user.Profile.custom_fields.calisma_gruplari.ust_yonetim }">
    <dt><a href="/Forum/pages/gorev_tanim/?type=ust_yonetim" target="blank_" rel="nofollow">
        <img class="Tooltip" src="/Forum/styles/gorev/ust_yonetim.png" alt="{{ $user.Profile.custom_fields.getDefinition('calisma_gruplari.ust_yonetim').title }}" width="40" height="40" title="Üst Yönetim" />
    </a></dt>
</xf:if>
 
You could try that once, but you didn't test it.
HTML:
<xf:if is="{ $user.Profile.custom_fields.calisma_gruplari.ust_yonetim }">
    <dt><a href="/Forum/pages/gorev_tanim/?type=ust_yonetim" target="blank_" rel="nofollow">
        <img class="Tooltip" src="/Forum/styles/gorev/ust_yonetim.png" alt="{{ $user.Profile.custom_fields.getDefinition('calisma_gruplari.ust_yonetim').title }}" width="40" height="40" title="Üst Yönetim" />
    </a></dt>
</xf:if>
This is not work.
 
Back
Top Bottom