Magnus Manske wrote:
I have commited an initial attempt at {{DISPLAYTITLE|Anything goes}}, turned off by default in case of unforseen side effects ($wgAllowDisplayTitle=true turns it on). We can still restrict this, but at least the infrastructure is there now.
Well I hate to tell you, but it doesn't work. :)
1) It breaks template inclusions.
This *should* include a template: {{My template|value}}
but instead it sets the display title to "value".
2) Most of the time it won't have any effect.
For some reason it's trying to set $wgOut's global title setting from the parser.
Most page views come from the parser cache -- the parser *does not run* at the time when the user comes to look at it. It ran on a previous view, or when the page was saved, and any ephemeral changes to $wgOut have long ago vanished.
To be useful at all, it would have to save the value into the ParserOutput object, and it would have to be retrieved from that output object (either immediately-rendered or from the cache) at display time.
3) It may have effect in places it shouldn't.
Previews, background rendering, display of message chunks inside a special page, etc might run the parser at many times other than a page view. This could lead to inappropriate overwriting of the special page's title information.
An immediate example is that the "Editing XYZ" message gets overwritten entirely when previewing.
Also I noticed a few weird bits in the code, such as this: $st .= str_replace ( "$1", $t, wfMsg('displaytitle') );
We removed this awkward construct a couple years ago, letting wfMsg() and friends accept parameters for replacements instead. It's generally much cleaner and more legible.
-- brion vibber (brion @ pobox.com)