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

XF 1.4 Can custom user fields be tested in extra.css?

Discussion in 'XenForo Questions and Support' started by RobParker, Oct 10, 2014.

  1. RobParker

    RobParker Well-Known Member

    Will this work in extra.css or does it need to be placed somewhere else?

    <xen:if is="{$visitor.customFields.gallery_alert.off} == 'off'">
    .navTabs .navLink .itemCount {
    display: none !important;
    }
    </xen:if>
     
    Last edited: Oct 10, 2014
  2. Brogan

    Brogan XenForo Moderator Staff Member

    That syntax won't work in EXTRA.css.

    You would need to place it in the relevant template.
     
    RobParker likes this.
  3. RobParker

    RobParker Well-Known Member

    Cheers

    Wasn't sure but thought that might be the case.

    Does it matter which template it actually goes in?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Depending on what you are trying to do, yes.
    The code in the format you have posted above won't actually work as the conditional statement would need to be wrapped around some HTML.

    If it's from an add-on you may be better off asking in the add-on thread.
     
    RobParker likes this.
  5. RobParker

    RobParker Well-Known Member

    I asked Chris but it's beyond the scope of his gallery support. I think it's pretty straight forward to do now I know where it can't go, thanks for the help :)
     
  6. RobParker

    RobParker Well-Known Member

    Fairly sure this works (though might be possible top target it a bit more).

    Navigation template
    Code:
      <a href="{$extraTab.href}" class="navLink<xen:if is="@xb_nav_disablearrow"> NoPopupGadget" rel="Menu</xen:if>">{$extraTab.title}<xen:if is="{$extraTab.counter}"><strong class="itemCount <xen:if is="{$visitor.customFields.gallery_alert.off} == 'off'">hide_gallery_alerts"></xen:if><span class="Total">{$extraTab.counter}</span><span class="arrow"></span></strong></xen:if></a>
    
     
  7. Steve F

    Steve F Well-Known Member

    You can combine it with the

    <xen:if is="{$extraTab.counter}">

    To

    <xen:if is="{$extraTab.counter} AND {$visitor.customFields.gallery_alert.off} != 'off'">

    I think that is the correct syntax, on my phone so I'm limited:p
     
    RobParker likes this.

Share This Page