Last modified: 2013-04-22 16:16:20 UTC
Implement wgFullPageName as the full page name (including localized namespace) without any encoding. I believe this is equivalent to wgPageName, but with underscores instead of spaces. But I think this is worth implementing so people don't have to think about encoding or decoding page names, when they just want the full actual name. The name is chosen since this is the behavior of the {{FULLPAGENAME}} magic word.
Sorry, I mean wgFullPageName would have spaces. wgPageName would be unchanged and continue to have underscores.
Implemented as https://gerrit.wikimedia.org/r/#/c/50341/ I reconsidered the name. Since all of the PageName ones currently use underscores, and the only Title one (wgTitle, title without namespace, doesn't), I went with wgFullTitle.
There are way too many title related variables already. Exporting every single variation is not a solution. Imho is escaping not an argument in this case. Escaping is always needed, nothing does that for you. As far as variations go, we have mw.Title for that. Feel free to re-open with a use case.
As Tyler said, it avoids having to use and depend on mw.Title for a very common use case (one which I think user script writers would also appreciate) There are at least two main reasons it would be useful: 1. This is the version used for display. 2. This is used for the title attributes of links (this is the main reason we want it). You're right it's not strictly necessary. But I think this one adds something useful above the existing ones (e.g. wgTitle).
var wgFullTitle = wgPageName.replace(/_/g, ' '); No need to depend on mw.Title for that ;)
I'm aware of that. The problem is then it becomes every script writer or reviewer's job to remember how wgPageName is escaped. It's poor separation of concerns.
I agree those variables are a mess. But one doesn't have to concerned about which variables contain what type of value and whether they are db or text versions. And adding another one certainly doesn't make that easier (sure they are both called "Title", but if that was simple enough, this wouldn't have been a bug, you said so yourself). The methods of mw.Title are pretty usable (e.g. mw.Title#toText aka #getPrefixedText for the non-underscore version, mw.Title#getPrefixedDb for the db version). We use the same system server-side with matching method names, and for the same reason: Those individual variables would've been a mess to deal with on the server-side. Construct an mw.Title once with whatever input (doesn't matter which title/page variable, it'll take it - though if you use wgTitle, be sure to pass the namespace as well). Then simply use it's methods to get the desired value (full name, just title, just namespace, in either text or db format)
(In reply to comment #7) > Construct an mw.Title once with whatever input (doesn't matter which > title/page variable, it'll take it As pointed out in #wikimedia-dev, it is best to construct it with wgPageName.