On 2015-06-23 12:00 AM, S Page wrote:
> The Blueprint skin uses data['title'], which doesn't work well [1] if a
> page uses
>
> {{DISPLAYTITLE:<span style="blah blah">{{FULLPAGENAME}}</span>}}
>
> to hide its title as suggested [2].
>
> Manual:Skinning [3] doesn't explain where data['*somekey*'] comes from or
> what the keys are. No problem, in a skin if you var_dump( $this->data )
> there are a dozen other title-like keys to choose from. But how do skin
> developers know which one to use? titletxt, titletext, titleprefixeddbkey,
> thispage, ...  Some are set(), some are setRef(), is that significant?
title should be correct. Manual:Skinning is the most up to date
documentation on the topic, written after most of the DISPLAYTITLE stuff
has long since been implemented.
(CoI Disclaimer: I wrote it)

Most of the other title keys in data especially ones like
titleprefixeddbkey should really just the same title (not sure if it's
the getTitle() or getRelevantTitle() title) in the different string
formats you'd get out of $title->getText(), $title->getPrefixedDbKey(),
etc...

Nowadays I'd consider them worthless or silently deprecated. Just grab
the Title instance you want and use the right method on that instance.
The data attributes are there because some time in the distant distant
past someone either thought they were a good idea or maybe MW was using
a really old template engine that only accepted the strings and could
not work with a title instance. And they exist currently I guess because
we don't know if they can safely be killed and keys in an array are hard
to deprecate in something like skins which probably have more private
custom implementations then extensions would have. (That, and no one has
bothered trying to remove them ;)).

set vs. setRef is an implementation detail you don't have to worry about.
setRef just acts like set but uses a PHP reference (&$foo) so that the
value changes when the variable outside ->data changes.

~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to