1. 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

Discussion in 'Styling and Customization Questions' started by Nudaii, Jul 3, 2015.

  1. Nudaii

    Nudaii Well-Known Member


    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?

    <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 :)
  2. Martok

    Martok Well-Known Member

    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?
  3. Nudaii

    Nudaii Well-Known Member

    yep the postbit is entirely custom :) uses none of the default xf fields, all custom fields used to pull images
  4. Jon W

    Jon W Well-Known Member

    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:
    {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.

Share This Page