Author Topic: Creating new Classes?  (Read 2284 times)

Offline embyr_75

  • Metroid Wiki Staff
  • ***
  • Posts: 36
  • Gender: Female
    • View Profile
Creating new Classes?
« on: September 03, 2013, 06:37:00 PM »
Hey Wiki People,

I'm trying to replace some old content on Metroid Wiki's front page and need to know how to create a new class.

If you look at the main page, you'll notice there are several "semi-transparent" images (one in the "news" box, and one in the "featured article" box). I believe these are implemented using a class="namehere", and I don't know how to reproduce it for the latest feature.

Hate to be a bother with my wiki illiteracy, but I'm impatient and my code-savvy admins are busy people.  ::)

Offline Tucayo

  • Super Mario Wiki Staff
  • ***
  • Posts: 1265
  • Gender: Male
    • View Profile
    • MarioWiki's Shroom
Re: Creating new Classes?
« Reply #1 on: September 03, 2013, 07:27:39 PM »
I'm not exactly code-savvy, but I think I can help you here.

By viewing the source of the Main Page you can see each box has its own class ("news", for example, is the class of the News box). If you go to MediaWiki:Common.css, you'll see the classes are listed here; here's what "news" says:

Code: [Select]
.news {
  background-image:url('http://cdn.wikimg.net/metroidwiki/images/f/fb/News_mainpage.png');
  background-repeat:no-repeat;
  background-position: center center;}

If you want to create a new class for a new feature, all you'd have to do is something like this:

Code: [Select]
.<class name here>{
  background-image:url('<background image here>');
  background-repeat:no-repeat;
  background-position: center center;}

I believe the images themselves are made semi-transparent beforehand.
« Last Edit: September 03, 2013, 08:48:52 PM by Tucayo »

Offline embyr_75

  • Metroid Wiki Staff
  • ***
  • Posts: 36
  • Gender: Female
    • View Profile
Re: Creating new Classes?
« Reply #2 on: September 03, 2013, 07:58:43 PM »
AHA! Most excellent!  ;D Thanks so much! That should work perfectly.

... I really need to learn to start figuring out this MediaWiki stuff myself.  :-[

Offline KidIcarus

  • Hero Member
  • *****
  • Posts: 905
    • View Profile
Re: Creating new Classes?
« Reply #3 on: July 07, 2015, 11:29:42 PM »
I'm curious now... what kind of classes are you thinking of making?