Changing settings based on forum node

Ryan Kent

Well-known member
My forums contain categories which are used by gaming guilds as their clan forums. I would like to offer each guild the opportunity to customize their category a bit. Specifically I would like to provide them the ability to use their own background image and sidebar blocks.

I found the background image code within template xenforo.css. What is the best way to set up a conditional to change the image based on the forum node? And do I need to list each forum node? or can I just list the category and then all child nodes are covered?

I also desire to add sidebar blocks for things like their ventrilo server and such but only within their guild category.

I understand the background css is contained within xenforo.css and the sidebar control is contained within forum_list templates. Basically I need to understand how to write a conditional for nodes and apply it in these two circumstances.

I did review the FAQ for conditionals and didn't see anything directly relevant. The closest I saw was conditionals based on user groups which would not be ideal in this situation.
 
You can't use a condition like that in the CSS. The better solution is to create additional styles.

You will need to create a new style for each guild forum:

Admin CP -> Appearance -> Styles -> Create New Style

You can create child styles of your main style so they will be identical to the parent, plus any additional customizations you make to the child (like background image and sidebar).

Then assign those styles to the individual forums:

Admin CP -> Applications -> Display Node Tree -> [click a forum] -> Override user style choice

Screen shot 2011-05-01 at 10.23.46 AM.webp
 
Nice solution!

My only concern is it seems XF doesn't do well when many styles are installed. Kier said he hopes to improve that aspect at a later point. This works great for now. Thanks for the idea Jake.
 
Top Bottom