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

XF 1.2 do conditionals woork in .css templates?

Discussion in 'Styling and Customization Questions' started by Nudaii, Sep 2, 2013.

  1. Nudaii

    Nudaii Well-Known Member

    as the title says, and also what would be a global variable to get the forum id :)

    OR atleast to work at forum_view and forum_list
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    Yes, you can use conditionals in any template. However, unless the information you need is there, they most likely need some extra work (ie, setting information in the container).
    Chris D likes this.
  3. Nudaii

    Nudaii Well-Known Member

    would it be very hard to get it working for the node's in forum list and forum view?

    I want to add a background image to the nodes (different per node) pulled by node id
  4. Chris D

    Chris D XenForo Developer Staff Member

    That is possible without conditionals.

    When you're in a node, the forum ID of the node you're in and its parent nodes are class names attached to the <body tag.

    <body class="node47 node22" style="">
    With that in mind, if you want node 22 to have a different background, you can target it like this:

        background-color: red;
    Just apply your background to your requirements. Nice and easy.
    AndyB, Jeremy and Nudaii like this.
  5. Nudaii

    Nudaii Well-Known Member

    Chris D likes this.

Share This Page