Template:NAMESPACEID
From Encyclopedia Thelemica
Jump to navigationJump to search10
Returns the namespace ID of page given, or of the current page. Template:Namespaces
Usage
- {{NAMESPACEID}} → 10
- {{NAMESPACEID|}} → 0 Template:Xt
- {{NAMESPACEID|{{ns:0}}}} → 0 Template:Xt
- {{NAMESPACEID|Talk}} → 1
Namespace aliases are accepted, too:
- {{NAMESPACEID|Image}} → 6
- {{NAMESPACEID|File}} → 6
- {{NAMESPACEID|WP}} → Invalid namespace in {{NAMESPACEID}}
- {{NAMESPACEID|Project}} → 4
- {{NAMESPACEID|Wikipedia}} → Invalid namespace in {{NAMESPACEID}}
Invalid input returns an error, which can be caught with the #iferror parser function:
- {{NAMESPACEID|Foo}} → Invalid namespace in {{NAMESPACEID}}
See also
The above documentation is transcluded from Template:NAMESPACEID/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |