Turns that that the "culprit" causing titles not to be hidden all the time given the __NOTITLE__
magic word, is the parser cache. Setting $wgEnableParserCache = false;
in LocalSettings.php
make this extension work as intended. Obviously, this is not a permanent fix for very busy sites that benefit from parser caching. Wonder if there is a way for the parser cache to cache dynamic style changes?
Topic on Extension talk:NoTitle
Another hack is to replace the inline style insert in NoTitle.body.php
with
$text = "<style>.firstHeading, .subtitle, #siteSub, #contentSub, .pagetitle { display: none; }</style>" . $text;
which works with parser caching enabled. Unfortunately, this does create "bad" HTML though FireFox and Chrome handle it. The style
should be in the head
section, unless it is scoped.
Great, thank you for investigating into this and it is interesting to read about it. It will indeed be great to have this extension working again. Just let me know if I should somehow move the code into the extension's repo. Cannot merge it, but finding one who does should be possible.