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

XF 1.4 display custom field text to postbit

Nudaii

Well-known member
#1
howdy

I am trying toi setup a rather complex system for an rpg site which will have several dozen badges.

what i need is to know if there is a way to have the alt/title show the text of the field vs the value?

Code:
<img src="/rpg/rol/faction_{$user.customFields.rol_ff_faction}.png" class="rpgIcon Tooltip" width="36px" height="36px"  title="*here*" alt="*here*" />
Example instead of faction_3 have it show "Rebel Alliance" etc :)
 

Martok

Well-known member
#2
You can display custom fields in the postbit by ticking the option in ACP > Appearance > Style Properties > Message Elements

Is there a reason why you're trying to do it a different way?
 

Nudaii

Well-known member
#3
yep the postbit is entirely custom :) uses none of the default xf fields, all custom fields used to pull images
 

Jon W

Well-known member
#4
The text is a phrase, but XenForo doesn't allow you to use variables in phrase names, so I think the only way to do this would be to use a full conditional if statement:
HTML:
{xen:if '{$user.customFields.rol_ff_faction} == faction_3', 'Rebel Alliance'}
The only other way is using an add-on to expose all the different phrases to the template in an array.