Last modified: 2014-03-30 03:31:25 UTC
The namespace parameter for Special:WhatLinksHere only accepts a numeric index: https://en.wikipedia.org/w/index.php?title=Special%3AWhatLinksHere&target=Example&namespace=4 It should also accept a namespace alias. At present a non-numeric value is ignored: https://en.wikipedia.org/w/index.php?title=Special%3AWhatLinksHere&target=Example&namespace=Wikipedia This would facilitate the development of utility templates.
(In reply to Scott Martin from comment #0) > This would facilitate the development of utility templates. Can you provide a specific example? Off-hand I'd think that the namespace ID would be better for use in a template (a programmatic context). The namespace name as a URL parameter requires encoding/quoting if there's anything remotely silly in it; for example, the space in "&namespace=Project talk" would need to be changed to a "_" or "%20" or something, while "&namespace=5" is perfectly fine. I don't imagine this request is particularly difficult to implement, but I'm still personally unsure the additional code complexity is warranted.
Sure; there's already a {{What links here}} on enwp, which is just a wrapper for [[Special:WhatLinksHere/Page name]]. You can't pass a namespace to it. An upgraded version would instead generate a link to a fully specified URL. As you note, the parameter name would need to be passed through {{urlencode:}} on the template side. Okay, all that said, I've just been informed that there is a hacky way to get a namespace index from its alias, by giving a fake page name to {{NAMESPACENUMBER}} - {{NAMESPACENUMBER:Namespace you're interested in:X}}. And I'm going to use that technique right now. So I guess this request is moot and I don't mind it being WONTFIXED on that basis - although I think it would be cool to have a non-hacky way to use a namespace alias directly.
WONTFIXing as bug 35486 makes this unnecessary - Special:WhatLinksHere is becoming embeddable and will take a namespace parameter.
I should note the parameter will still be numeric only.
Oh, right. What I meant by that question on the other bug was specifically would it take a text parameter as suggested in the bug filing. As the workaround I mentioned above exists, I'll reopen this as a lowest priority enhancement without prejudice against a re-WONTFIX from anyone who knows better.