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

XF 1.4 Style fields

Discussion in 'Styling and Customization Questions' started by RichardKYA, Feb 14, 2015.

  1. RichardKYA

    RichardKYA Well-Known Member

    Hello,

    Does anyone know how to call style fields using xen:if?

    I know how to call customFields using

    <xen:if is="{$visitor.customFields.header_color} == 'blue'">

    but what I would like is to call a created style field.

    <xen:if is="{$visitor.__________.________} == 'style name'">

    where I've left it blank is the part I don't know and the "style name" is the actual name shown and not the field name because I don't know how to call this either.

    Does anyone know the fields I need?

    The reason is, I am allowing users to have some header color choices, but I have also created a "Night Mode" Style which makes everything darker, so I would like this to "overwrite" any header color and make it dark also.

    So, if possible I would like something like this:

    <xen:if is="!{$visitor._______.______} == 'Night Mode' AND {$visitor.customField.header_color} == 'blue'">

    CODE HERE

    </xen:if>

    Basically, if it's not Night Mode Style and header is blue, then they can have a blue header.

    Any help would be appreciated

    Thank you

    Richard
     
    Last edited: Feb 14, 2015
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. RichardKYA

    RichardKYA Well-Known Member

    Hello Brogan,

    I am having trouble with this. The top example doesn't work, but the bottom one does. These are just examples, but the idea is to have hidden blocks, unless the user wants them to be visible by selecting the check box. For some reason the negative value works, (the block is displayed unless the check box is selected), but if I remove the "!" to have it the other way, it hides the block as wanted, but it still remains hidden even with the check box selected.

    <xen:if is="{$visitor.customFields.forum_stats} == 'show'">

    CODE HERE

    </xen:if>


    <xen:if is="!{$visitor.customFields.forum_stats} == 'hide'">

    CODE HERE

    </xen:if>


    Am I missing something?

    Thank you

    Richard
     

Share This Page