Thanks Greg,
I think I understand.
Can you take a peek at this and tell me if you see any glaring issues:
$wgMyDivHTML = "<div class=MyTopLeftDiv><a
id=MyTopLeftDivLink>text</div>";
$wgMyTopLeftDivFn = new MyTopLeftDivFn();
$wgHooks['OutputPageBeforeHTML'][] = $wgMyTopLeftDivFn;
class MyTopLeftDivFn {
public function onOutputPageBeforeHTML( OutputPage &$out, &$text ) {
global $wgMyDIvHTML;
$text = strtr( $text, $wgMyDivHTML );
return $out;
}
}
_______________________________________
From: MediaWiki-l [mediawiki-l-bounces(a)lists.wikimedia.org] on behalf of Greg Rundlett
(freephile) [greg(a)freephile.com]
Sent: Tuesday, April 24, 2018 2:21 PM
To: MediaWiki announcements and site admin list
Subject: Re: [MediaWiki-l] help with hook in localsettings
Hi Rich,
I'm not a hook expert, so not sure about this. But, the
https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageBeforeHTML manual
shows that it acts on both $out and $text. Furthermore, the talk page says
that using the first could lead to an infinite loop, so I'd suggest using
$text for the '...tbd...
There's also an example in the talk page.
https://www.mediawiki.org/wiki/Manual_talk:Hooks/OutputPageBeforeHTML
Greg Rundlett
https://eQuality-Tech.com
https://freephile.org
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l