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

XF 1.4 Different backgrounds for different categories?

Discussion in 'Styling and Customization Questions' started by creativeforge, Mar 21, 2015.

  1. creativeforge

    creativeforge Active Member

    Hi all,

    So I want to match a background color/image for the whole page, that will match these headers.

    I've been reading many threads on this trying to figure out how to do it. Most address having different colors in the categories backgrounds. A few suggestions, though, so I've tried this here:

    body.node2
    {
    background: #123456 url('path/to/background2.gif') repeat top;
    }

    body.node8
    {
    background: #000000 url('path/to/background8.gif') repeat top;
    }

    I've even tried tweaking it and try a few variants, but... no joy. Am I missing a step, a setting in the Admin, etc.?

    Thank you in advance!

    Andre
     

    Attached Files:

    Last edited: Mar 22, 2015
  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. creativeforge

    creativeforge Active Member

    Hi Brogan,

    Yes, I have seen many such instructions. But what I want to do is not to change the category strip, but the whole page background...
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    The principle is the same.

    If you are using pages for categories then the template class is category_view.
    You will then need to construct CSS utilising that class and the category node ID.
     
    rafass likes this.
  5. creativeforge

    creativeforge Active Member

    Thanks Brogan, could you give me an example of the code for one such background for the nodes?

    body.node8
    {
    background: #000000 url('path/to/background8.gif') repeat top;
    }

    li.node.page.level_2.node_146 {background: #ccc;}

    None of these seem to work.

    Many thanks!
     
  6. creativeforge

    creativeforge Active Member

    category_view?

    OK, I don't understand what this means: "If you are using pages for categories." I am using what's there, I did not make changes.
     
  7. rafass

    rafass Well-Known Member

    This?
    R 2015-04-27 at 23.09.38.jpg
    ACP -> Options -> Node & Forum List
     
    creativeforge likes this.
  8. creativeforge

    creativeforge Active Member

    rafass, thanks! YES! I keep being amazed by Xenforo... :)

    Merci Montreal! (y)
     
  9. RDR

    RDR Well-Known Member

    Couldn't you just create a child style, update the body style property and then assign that style to the category/node?

    Make these child styles non-user selectable and you have an easier system to manage I think.

    Cheers,

    Regs.
     
  10. creativeforge

    creativeforge Active Member

    Thanks Regs, that's another idea, but I was never successful in making my styles "non-user selectable." Not sure why.
     
  11. Amaury

    Amaury Well-Known Member

    If you don't want styles to be user selectable, simply uncheck the check boxes:

    Styles.png
     
    RDR likes this.
  12. creativeforge

    creativeforge Active Member

    Thanks, I've tried this too. I decided to uninstall the styles not in use, it fixed my particular issue.

    Cheers!
     

Share This Page