Extension:SimpleFooterLink

Category:Extensions without an imageCategory:GPL licensed extensions
MediaWiki extensions manual
SimpleFooterLink
Release status: betaCategory:Beta status extensions
Implementation User interfaceCategory:User interface extensions
Description This extension provides a simple way to add any link that system administrators want to footer link area.
Author(s) AnnAngelatalk
Latest version 0.1.1 (2021/03/23)
Compatibility policy For every MediaWiki release that is a Long Term Support release there is a corresponding branch in the extension.Category:Extensions with long-term support release branches compatibility policy
MediaWiki 1.35+Category:Extensions with manual MediaWiki version
License GNU General Public License 2.0 or later
Download Category:Extensions in GitHub version control
$wgSimpleFooterLinkArray
Category:All extensionsCategory:Extensions not in ExtensionJson

The SimpleFooterLink extension provides a simple way to add any link that system administrators want to footer link area.

This extension requires MW 1.35.0 or higher. If you have lower MW version, just simply use legacy way.

Installation

  • Download and place the file(s) in a directory called SimpleFooterLink in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'SimpleFooterLink' );
    $wgSimpleFooterLinkArray = [ /* see [[#Configuration parameters]] */ ];
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage

  1. Add link to a wiki page at footer link area:
    $wgSimpleFooterLinkArray = [
        [
            "name" => "ALink",
            "tag" => "a",
            "attr" => [
                "href" => "Extension:SimpleFooterLink"
            ],
            "innerHTML" => "Extension:SimpleFooterLink",
        ]
    ];
    
    The link Extension:SimpleFooterLink will be added.
  2. You can add extenal link, multiple links, links with blob text, and even not link but <table> (but to be honest table looks ugly in this situation):
    $wgSimpleFooterLinkArray = [
        [
            "name" => "ALink",
            "tag" => "a",
            "attr" => [
                "href" => "https://www.mediawiki.org/wiki/Extension:SimpleFooterLink"
            ],
            "innerHTML" => "Extension:SimpleFooterLink",
        ],
        [
            "name" => "AnotherLink",
            "tag" => "a",
            "attr" => [
                "href" => "https://zh.moegirl.org.cn/",
                "target" => "_blank"
            ],
            "innerHTML" => "<b>MoegirlPedia</b>",
        ],
        [
            "name" => "NotALink",
            "tag" => "table",
            "attr" => [
                "style" => "border-width: 0;",
                "class" => "wikitable"
            ],
            "innerHTML" => "<tr><td>cell</td></tr>",
        ]
    ];
    

Configuration parameters

Configuration parameters
Name Value typing
$wgSimpleFooterLinkArray Unnamed array, fulfilled with key-value named array described as right
(Forgive my poor English ...)
name string

Must be identical, or only the very last one keep and other lost.

tag string

HTML element tagname, in lower case, pass to Html::rawElement as first parameter - $element.

attr key-value named array

HTML attributes key-value map, pass to Html::rawElement as second parameter - $attribs, also see Html::expandAttributes for detail.
CAUTION: if tag is "a", attr has key "href", then attr.href will be parsed by Skin::makeInternalOrExternalUrl first.

innerHTML string

HTML string without escaped, pass to Html::rawElement as third parameter - $contents.

TODO

  • Add ability to use the MediaWiki message system.
Category:All extensions Category:Beta status extensions Category:Extensions in GitHub version control Category:Extensions not in ExtensionJson Category:Extensions with long-term support release branches compatibility policy Category:Extensions with manual MediaWiki version Category:Extensions without an image Category:GPL licensed extensions Category:SkinAddFooterLinks extensions Category:User interface extensions