XF 1.5 Userfields and conditional statements issue

So I'm trying to allow users to change the background color for an element if the preference is set.
This is the field:
Field ID: colorStyle
Possible Choices: colorGradient
Type: Radio Buttons

And my code looks like:
Code:
.navTabs {
    <xen:if is="{$visitor.customFields.colorStyle.colorGradient}">
        background-color: #ffffff;
    <xen:else />
        background-color: #ff0000;
    </xen:if>
}

I have looked at the conditional statements page, and read the user fields page, so everything seems to check out nicely.
But nothing happens when I change the preference. Anyone?
 
Last edited:
You can’t use conditionals in CSS templates, they will just be ignored when all your CSS templates are compiled and minimised by XF.

It needs to be applied at the template, in your case try looking at template: navigation.
 
Top Bottom