Wikia

Community Central

Comments4

FAfC

This Frequently Asked-for Codes (FAfC) blog is meant to showcase codes people frequently ask for, whether they're aware of it or not. I've given you these to start out with; if you want another one covered that isn't already on here, tell me in the comments!

CSS

"How do I replace the chatmod star with something else?"

Put this in your wiki's MediaWiki:Chat.css, replacing the example URL with the URL of the image you want:

/* Remove existing mod star */
.User.chat-mod .username:after {
    background-image:none;
}
 
/* Add new mod star */
.User.chat-mod .username:after {
    content: url("http://images3.wikia.nocookie.net/__cb20150305184300/zedd/images/4/48/Chatmod_icon.png");
}

"How do I highlight admin names?"

Put this in your wiki's MediaWiki:Common.css, replacing "Admin Username" with the username of the admin. Remember to do underscores instead of spaces for usernames with multiple words.

a[href$=":Admin_Username"], a[href$="/Admin_Username"] {
    color: blue !important; /* this can be any color or hex code */
    font-family: Arial  !important; /* this can be any font family Wikia recognizes */
}

"How do I get the local navigation menu to have rounded borders?"

Put this in your wiki's MediaWiki:Wikia.css:

/* Rounded corners for nav */
 
.WikiHeader .navbackground, .WikiHeader > nav .subnav-2 {
     border-radius: 0 5px 0 5px;
}
 
.WikiHeader > nav li:first-child {
     border-radius: 5px 0 0 0;
}
 
.WikiHeader > nav li:last-child {
     border-radius: 5px 0 0;
}
 
.WikiHeader nav li.marked, .WikiHeader > nav .subnav-2 .marked2 .subnav-2a {
     border-radius: 5px 5px 0 0;
}
 
.WikiHeader nav {
     border-radius: 1em 1em 0 0;
}
 
.WikiHeader > nav li.marked > a {
     border-top: none;
}
 
.WikiNav .navbackground > div {
    background-color:transparent;
}
 
.WikiNav .nav-item.marked > a {
    border-color: transparent;
}
 
.WikiHeader > nav .subnav-3 {
     border-radius: 0 5px 5px 5px;
}
 
.WikiHeader > nav li.marked > a {
     border-top: none;
}

JavaScript

Please remember that there are currently restrictions on editing JavaScript and certain MediaWiki pages. For more information, see here and here.

"How do I get {{USERNAME}} to work?"

If you haven't already created the template, create it as Template:USERNAME with the following code:

<span class="insertusername">{{{1|<insert name here>}}}</span>

Then add the following JavaScript to your wiki's MediaWiki:Common.js:

/* Replaces {{USERNAME}} with the name of the user browsing the page.
   Requires copying Template:USERNAME. */
 
function UserNameReplace() {
    if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName === null) return;
    $("span.insertusername").html(wgUserName);
 }
 addOnloadHook(UserNameReplace);
 
/* End of the {{USERNAME}} replacement */

Around Wikia's network

Random Wiki