MyBB Community Forums

Full Version: Different StyleSheets & Templates For Each Category?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm wondering if it's possible to add different stylesheets & templates for each category.

I'd like to choose which stylesheet & templates to load for a specific category, sub-category, sub-sub-category, etc, and all the stylesheets & templates are in 1 theme.

Is this possible with PHP or template conditionals?
It is, but you would have to do long conditions like:
<if $GLOBALS['fid'] == 1 then>.<elseif $GLOBALS['fid'] == 2 then>..<elseif $GLOBALS['fid'] == 3 then>...<elseif $GLOBALS['fid'] == 4 then>....<else>etc.</if>

For a job like this I rather recommend using XThreads:
http://mybbhacks.zingaburga.com/showthread.php?tid=288
Then you will be able to add templates with prefixes, which is in my opinion a lot more efficient, and create forums like these example applications: http://mybbhacks.zingaburga.com/showthread.php?tid=559
Hello,

WOW, I'm a bit overwhelmed with XThreads upon first reading it, I actually have no idea what it does exactly, but it seems like a great plugin.

How exactly would I achieve different global.css & template files for each different forum category using XThreads?

Oh and using the template conditionals, how would I load different global.css & template files for each different forum category? I would have to replace the '.' from "<if $GLOBALS['fid'] == 1 then>." with the different global.css & template files but I have no idea how I would do this.
you dont want this for the index page, but for the forum once you view it (forumdispaly.php), correct? if so, MyBB has the functionality built-in. create the theme and template sets you want and then set the theme override on the forum settings.
(2013-10-02, 02:13 PM)pavemen Wrote: [ -> ]you dont want this for the index page, but for the forum once you view it (forumdispaly.php), correct? if so, MyBB has the functionality built-in. create the theme and template sets you want and then set the theme override on the forum settings.

Correct, I don't want this for the index page, only for categories, sub-categories, sub-sub-categories, etc.

Will that work for every separate category?
yes you can the theme specific to the forum when you are in the acp and editing a forum
Ok, say I have a category called 'Pokemon'. I would have a 'Pokemon theme' specific to this category and all threads/posts in this category.

Lets say I have a child category called 'Pokeballs'. I would have a 'Pokeballs theme' specific to this child category for all threads/posts in this category.

So a separate theme for each category, child category, child child etc for everyone to see.

Is this a core feature of mybb?
^ yes, that is possible. however it would be better to use a single templates set for all the themes
as it will be difficult to maintain many templates sets while installing plugins / changing the code
(2013-10-03, 12:49 PM).m. Wrote: [ -> ]^ yes, that is possible. however it would be better to use a single templates set for all the themes
as it will be difficult to maintain many templates sets while installing plugins / changing the code

How would I achieve that in a single template set?