Jump to content

How to individually customise forums and categories
   (0 reviews)

Kit the Human
  • Want to customise your forums individually? A different background image for every forum? A different colour for every category? This guide will show you how to do it for mybb.

    Software: MyBB

The magic is done with ids. Every category and forum is assigned a number, you can find this number by hovering over their link and looking at the URL. The URL will look something like this:

https://URL.com/forumdisplay.php?fid=1

The number on the end is the forum/category's ID!

 

We will use the forum ID in the forum's class to help us differentiate between each forum.

 

The two templates you'll want to edit are:
 

  • forumbit_depth1_cat - for the category
  • forumbit_depth2_forum - for the forum

 

And the fantastic variable you want is

{$forum['fid']}

Essentially, what you want to do is give your category and forums a class in the aforementioned templates. These classes should be:

 

  • category no{$forum['fid']}
  • forum no{$forum['fid']}


Which looks like this in CSS (with the number varying)

.category.no1 { /* stuff here */ }
.forum.no1 { /* stuff here */ }

So what's with the space? The space allows us to do the bulk of your styling without needing to repeat yourself. For example. If you want all forums to have uppercase 14px text. You need only type in the following:

.forum {
  font-size: 14px;
  text-transform: uppercase;
}

Now you want to target one particular forum to have a certain background with a certain text color?

.forum.no1 {
  background: #0a0a0a;
  color: #efefef;
}

The final result being:

.forum {
  font-size: 14px;
  text-transform: uppercase;
}

.forum.no1 {
  background: #0a0a0a;
  color: #efefef;
}

Forum number one will still have 14px uppercase text!

 

Sure beats having to repeat yourself!

 

I won't give you the HTML code for your category and forum, because it depends entirely upon your design. Just make sure you use the classes given and you're set to make your forums and categories diverse little individuals!


  • I read this! 1



User Feedback

Create an account or sign in to leave a review

You need to be a member in order to leave a review

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

There are no reviews to display.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.