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

XF 1.4 Header change based upon custom user field response

Discussion in 'Styling and Customization Questions' started by Abreau, Oct 18, 2014.

  1. Abreau

    Abreau Member

    I am rather Xen illiterate so I am looking for assistance. Basically, I am trying to make an automated header change based upon a user's selection in a custom field. I don't know how I would go about doing so, but if possible I would like to do it through templates.

    I know the conditional for the custom user field but that's about it. What I'd be looking to do is the following:
    <xen:if is="{$visitor.customFields.field_id}">

    I would like each answer to reflect a different header.

    Any help is appreciated.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Check each value:

    <xen:if is="{$visitor.customFields.field_id} == 'value1'">
    <xen:elseif is="{$visitor.customFields.field_id} == 'value2'" />
    <xen:elseif is="{$visitor.customFields.field_id} == 'value3'" />
    <xen:else />
    That will allow you to define different html depending on the value.

Share This Page