Last modified: 2012-04-04 19:33:04 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36355, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34355 - add a variable and parser function for the namespace number
add a variable and parser function for the namespace number
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.20.x
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-12 17:16 UTC by Umherirrender
Modified: 2012-04-04 19:33 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Umherirrender 2012-02-12 17:16:14 UTC
The {{NAMESPACE}} variable always give the namespace text, but this text can change, due to a configuration or localisation change. Having a way to get the namespace number makes it possible to avoid a breaking of conditions or transclusion by a change of a namespace.

Using {{NAMESPACE}} and {{ns:0}} inside a #ifeq does not have this problem, but when using the {{NAMESPACE}} in transclusion of a page, you have this problem or you have to use a big switch to map the name against the number, but getting the number direct from MediaWiki sounds better.

Please add a {{NAMESPACENUMBER}} variable and also a parser function {{NAMESPACENUMBER:pagename}} (like NAMESPACE).

Maybe call it NAMESPACEID, I am not sure, which is a better name.

Thanks.
Comment 1 Brion Vibber 2012-02-14 21:33:11 UTC
I'm a bit leery of this because the ids may become much more variable in the future... but it's probably not a problem to do.
Comment 2 Fomafix 2012-02-24 09:02:50 UTC
Useful situation for NAMESPACENUMBER:

https://de.wikipedia.org/w/index.php?title=MediaWiki:Flaggedrevs-categoryview&diff=99966481
Comment 3 Fomafix 2012-03-24 12:53:33 UTC
Workaround: [[de:Vorlage:NAMESPACENUMBER]]
Comment 4 Umherirrender 2012-04-01 10:31:18 UTC
Commited a patch with Gerrit change #4056
Comment 5 Umherirrender 2012-04-04 19:33:04 UTC
successfully merged by Brion

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links