• 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

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

Jake Bunce

XenForo moderator
Staff member
#2
Check each value:

Code:
<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 />

</xen:if>
That will allow you to define different html depending on the value.