-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the bfgminer-b12btcgpub-ledger wiki!
MediaWiki Manual:Footer
Transactions:English español italiano polski русский • 中文 • 日本語 MediaWiki version: ≥ 1.17 As of 1.17 and after you can modify the list of links in the footer using the SkinTemplateOutputPageBeforeExec to modify the footerlinks arrays and setting new template keys for the values.
For example, putting this in your LocalSettings.php file will add a new "Terms of Use" link after the disclaimer link.
$wgHooks['SkinTemplateOutputPageBeforeExec'][] = function( $sk, &$tpl ) { $tpl->set( 'termsofuse', $sk->footerLink( 'termsofuse', 'termsofusepage' ) ); // or to add non-link text: $tpl->set( 'footertext', 'Text to show in footer' ); $tpl->data['footerlinks']['places'][] = 'termsofuse'; return true; };
Put "Terms of Use" in the page MediaWiki:Termsofuse on your wiki, for the link's text and in MediaWiki:Termsofusepage define the title of the page that you want the Terms of Use link to point to. Note, if you do not create these pages on your wiki, then nothing will appear in the footer.
Add e.g.for the following CSS to MediaWiki:Common.css: li#footer-termsofuse { float: left; margin-right: 2em; } If you are writing an extension using MediaWiki 1.28 or later. (1) Add extension.json:
"Hooks": {
"SkinTemplateOutputPageBeforeExec": [
"MyExtensionHooks::onSkinTemplateOutputPageBeforeExec"
]
},
(2) Add this to your MyExtension.hooks.php:
public static function onSkinTemplateOutputPageBeforeExec(&$skin, &$template) {
$template->set('FooTag', $skin->footerLink('FooTag', 'FooPage'));
$template->data['footerlinks']['places'][] = 'FooTag';
return true;
}
(3) Create three pages:
MediaWiki:FooLabel (contains text to display in footer, like 'Foo'); MediaWiki:FooPage (contains namespace:title of linked page, like 'Project:Foo'); Project:Foo (contains detailed page text). Remember it may take a while to update due to MediaWiki caches. In case you are using Extension:MobileFrontend, inserts a "Mobile view" link in the footer after the disclaimer link, the new footer links will come after the "Mobile view" link. To solve this, insert the above new footer links code before the code lines used to load the MobileFrontend extension.
Content is available under CC BY-SA 3.0 unless otherwise noted.