Quote:
In your LocalSettings.php file, place the following:
The "iconizelinks" script is, of course, optional. You can also add more scripts if you wish to the two shown. Just add more <script defer></script> lines. You can also remove the defer instruction if you wish.
# Load JavaScript
$wgHooks['BeforePageDisplay'][] = function( OutputPage &$out, Skin &$skin ) {
$code = <<<'START_END_MARKER'
<script defer src="https://zam.zamimg.com/j/tooltips.js?c"></script>
<script defer>var zam_tooltips = { "iconizelinks": true }</script>
START_END_MARKER;
$out->addHeadItem( 'my-wonderful-script', $code );
return true;
};
The "iconizelinks" script is, of course, optional. You can also add more scripts if you wish to the two shown. Just add more <script defer></script> lines. You can also remove the defer instruction if you wish.
The reason for using this method rather than the current one on that ZAM page is that the current method listed there requires you to edit the MediaWiki skin, which means that every time you upgrade your MediaWiki site you have to do it again. By adding the code I recommend, you just add it once to your LocalSettings.php file and never have to touch it again unless breaking changes are made.
Edited, Dec 21st 2020 8:10pm by Fanra