O'Reilly logo

MediaWiki by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Changing Appearances

MediaWiki’s default look and feel is familiar to any Wikipedia visitor. All the same, you might want to change it for various reasons: reflecting the theme of the wiki, matching your corporate branding, or simple personal preference. Fortunately, the look is highly configurable, although the means for changing it is spread across cascading stylesheets, configuration settings, system messages, and more. This chapter will guide you through the maze of changing your wiki’s appearance. (Read Chapter 11 first to learn about configuration in general.) For CSS changes, it’s assumed that you’re using the default MonoBook skin or another skin derived from it.

Tip

After any CSS change, force-refresh your browser to clear its cache and pick up your changes.

If an article does not change as expected, try purging the page from MediaWiki’s cache by appending the query parameter action=purge onto the URL. (This should rarely be needed, however.)

The Basics

Let’s start by configuring your wiki name, logo, and home page.

Wiki Name

The name of your wiki is stored in the configuration setting $wgSitename, in the file LocalSettings.php:

$wgSitename = 'BongoWiki';

This name is also available within wikitext as the variable SITENAME:

Welcome to {{SITENAME}}!

Logos and Icons

The graphical logo on every page is determined by the configuration setting $wgLogo in LocalSettings.php. Any 135×135 pixel image will do, ideally with a transparent background. You can point to a URL:

$wgLogo ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required