Topic on Project:Support desk

How to add a default footer link in MediaWiki >=1.35.0

6
182.232.183.244 (talkcontribs)

Say I have a >=1.35.0 MediaWiki website with the Timeless responsive skin.

I desire to add a link to the default footer menu of that site, programatically, by PHP (most probably with a hook);

I desire to do so without an installed extension and not via frontend.


This in LocalSettings.php didn't help and causes the site to crash:

public static function onSkinAddFooterLinks( Skin $skin, string $key, array &$footerlinks  ) {

   if ( $key === 'places' ) {

       $footerlinks['test'] = '<A href=#>Test Link</a>';

   }

}

Error:

Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting end of file in /PATH/LocalSettings.php on line 137


How to add a default footer link in MediaWiki >=1.35.0?

182.232.183.244 (talkcontribs)

Sorry, I did the test on a 1.34.0 website ; so idiotic from my side; Awww I hate to upgrade

Ammarpad (talkcontribs)

In LocalSettings.php you have to use Manual:$wgHooks and a callback. See the variable documentation for the multiple ways to do so. (BTW, this problem has no relation with upgrade, though updgrading is a good idea too.)

182.232.183.244 (talkcontribs)
TiltedCerebellum (talkcontribs)
182.232.185.156 (talkcontribs)

@TiltedCerebellum for hiding I have created another thread and would discuss it htere;

Back to that thread's main topic: I don't know how to write the PHP code; if you want to share with us who you will add a link to that menu with PHP, that would be a great help, I am sure.

Reply to "How to add a default footer link in MediaWiki >=1.35.0"