Configure the Footer-tagline

From mw.mh370.wiki
Jump to navigation Jump to search


A Guide to Using MediaWiki in a Hosted Environment

An instructional website by the developer of mh370wiki.net - a MediaWiki site about Malaysia Airlines Flight MH370.


The current public version of the mh370wiki.net website is, as one would expect, at www.mh370wiki.net.

To distinguish this from a development version (also on-line) I added a Footer-tagline.

The text of a Footer-tagline is placed in MediaWiki:Footer-tagline, but to enable the Footer-tagline to exist, some code must be added to LocalSettings.php.

Modify LocalSettings.php

The Manual:Footer provides the method:-

Add text to the footer

You can also add custom text through LocalSettings.php. Here is an example to add wikitext to the footer:

$wgHooks['SkinAddFooterLinks'][] = function ( Skin $skin, string $key, array &$footerlinks ) {
    if ( $key === 'info' ) {
        $footerlinks['tagline'] = $skin->msg( 'footer-tagline' )->parse();
    }
};

This adds footer-tagline as a key for the system message to be displayed in the footer. After adding the code to LocalSettings.php, please edit the MediaWiki:Footer-tagline page to edit the newly-added footer text.

MediaWiki:Footer-tagline

Major updates to the mh370wiki.net site are identified by a version number. Here is the Footer-tagline text for Version 4:-

And here is what it looked like on-screen:-


CSS and Footer-tagline

To style the Footer-tagline, the following was added to MediaWiki:Vector.css:-

/* 30 Jan 2025 Added footer-info-tagline */
#footer-info-tagline {  margin-top: -2em; text-align: center; 
   font-size: var(--font-size-875); color: #58565d; font-weight: 600;
   font-family: "Arial Black", Gadget, sans-serif; font-style: oblique;
} /* Similar to Tagline */

footer-tagline or footer-info-tagline?

Based on the lines added to LocalSettings.php (above) one might expect to style footer-tagline, but by using Firefox Web Developer Tools, it seems that footer-info-tagline was appropriate.


Other Uses

During the process of upgrading Version 4 of the mh370wiki.net website from MediaWiki version 1.39.8 to 1.43.1 I had two instances of the Version 4 site so decided to add the MediaWiki version to the Footer-tagline.

Similarly, I had a development version of the mh370wiki.net website which was using MediaWiki version 1.39.8 and also upgraded to 1.43.1, so I added the MediaWiki version to the Footer-tagline. That example is here:-


The different Content-versions with different MediaWiki-versions could be confusing, even though they have different URLs. But Footer-tagline provides a simple method to label each version. Of course if the Footer-tagline is styled to use a font similar to the other footer items - Privacy, About Site and Disclaimers - it does not have to be as prominent as my examples.


See Also

Customise the Tagline



Links

Manual:Footer https://www.mediawiki.org/wiki/Manual:Footer