MyBB Community Forums

Full Version: Different categories color/background
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey? Do you want to have different categories colors or backgrounds? It's simple!

Preview:

[Image: cUz7xUI.png]

Instructions:

Step 1: Go to ACP → Templates & Style → Templates → Your Theme Templates → Forum Bit Templates → Edit forumbit_depth1_cat.

Step 2: Add new class bar{$forum['fid']} next to tborder class.

Quote:<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder bar{$forum['fid']}">

{$forum['fid']}
mean category ID, so click any category and you'll see ID in address bar:

[Image: iUr73W9.png]
Step 3: Create new class in global.css (ACP → Templates & Styles → Themes → Your Theme → global.css → Advenced Mode)

Create new class named .barID .thead where ID mean your category ID.

Example:

Quote:.bar1 .thead {
 background: green;
}

bar1 mean that ID of category is 1. Add another classes with another IDs.

Done! Thanks!
Cool  very interesting...

thanks for the tutorial.

Its Very Cool the Color Categories!
Actually a very neat tweak. Thanks for sharing it with the community!
Great working perfect.
This is something i have posted few years ago : http://community.mybb.com/thread-148818.html
you can check my site for demo Smile
regards
I was wondering can you use custom colors and not just primaries? for instance #750000 Btw a great plus for me is that it works on my test board mybb 1.8.13 so I can get back my personal page afterall thank you!
(2017-11-17, 11:17 PM)Starnova Wrote: [ -> ]I was wondering can you use custom colors and not just primaries?  for instance #750000  Btw a great plus for me is that it works on my test board mybb 1.8.13  so I can get back my personal page afterall   thank you!

Its CSS, so you can include anything you wish - including a background image.
Perfect! thank you!
And an image in place of color?
(2019-07-12, 12:56 PM)Diamante Wrote: [ -> ]And an image in place of color?

Use an url in the background: background:url(../your/bgimage.png) repeat #c0c0c0;
Pages: 1 2