Skip to content


How to customize the “Powered by” icon in MediaWiki

Update (2011-07-02): as of MediaWiki 1.17, the powered by icon can now be modified through LocalSettings, by using the $wgFooterIcons parameter. For instance, on Wiki4Games we now have:
$wgFooterIcons["poweredby"]=array(
"mediawiki" => array(
"src" => null,
"url" => "/Wiki4Games:Powered",
"alt" => "Powered by MediaWiki and other things",
));

Original post follows.

A short post for a change 🙂 Inspired by the “Powered by” page at the Linux Kernel Archives (“Kernel.org”), I wanted to place a Powered by page on Wiki4Games. In order to make it reachable, I thought that rather than eating up once again more space from the site layout I could just hijack the already existing “Powered by MediaWiki” button at the bottom right of the page (that’s how it’s placed in Monobook and Vector at least).
The problem is, editing that button isn’t as simple as editing some other pieces of the skin: for some reason it’s hidden quite deeper. Not too hard to find though, I don’t really remember how I arrived there, but the thing you need to edit is located in includes/Skin.php, and more precisely within function getPoweredBy() around line 1539 (at least that’s where it is in MediaWiki 1.16.2). This 4-line function should be rather straightforward to edit (if you don’t think so, you should probably quit trying right now :P). Here is the original version:

function getPoweredBy() {
	global $wgStylePath;
	$url = htmlspecialchars( "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" );
	$img = '<a href="http://www.mediawiki.org/"><img src="' . $url . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
	return $img;
}

And here is the modified one just as it is right now @Wiki4Games:

function getPoweredBy() {
	global $wgStylePath;
	$url = htmlspecialchars( "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" );
	$img = '<a href="/Wiki4Games:Powered"><img src="' . $url . '" height="31" width="88" alt="Powered by MediaWiki and other things" /></a>';
	return $img;
}

(as you see, from here you can change about every aspect of that button – picture, target, size… even just hide/remove it)

Update (2011-03-05): added the original version, from MediaWiki 1.16.2

Posted in MediaWiki.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA