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.
Version: 1.20.x
Severity: enhancement