XF 2.0 Display Custom Field Text instead of Value

SpecOpsX

Member
Licensed customer
Hello.

I've created a custom field for "Clan Rank" on my clan site. It uses drop-down multiple choice for selection.

I've modified the Member List to display the selected rank for each person with the following code:
<dt>{{ phrase('Rank')}}</dt>
<dd>{$user.Profile.custom_fields.rank|text}</dd>

However, this displays the Value of the member's rank rather than what was displayed in the selection text field. I guess this would be okay if it were possible to have "space" characters in between words for the value (like High&nbsp;Council for High Council) but illegal chars and spaces aren't possible there.

Is there any way I can display the text instead of value? (Or add a insert space to my value variable?)

Thanks!
 
I will try Jon W's potential solution from this thread:

I will reply if it works =)
 
Yep. Slight modifications to his syntax did the trick. Here's the skinny:

Code:
<xf:if is="$user.Profile.custom_fields.rank == 'HighCouncil'">
     Rank: High Council
</xf:if>
 
Thanks, Jeremy P!

Code:
{$user.Profile.custom_fields.getFormattedValue('rank')}

Worked like a charm, and saved me from having to type out several different if statements.
 
Back
Top Bottom