Template:NAMESPACEID
Jump to navigation
Jump to search
10
Returns the namespace ID of page given, or of the current page.
Wikipedia namespaces | |||
---|---|---|---|
Subject namespaces | Talk namespaces | ||
0 | (Main/Article) | Talk | 1 |
2 | User | User talk | 3 |
4 | Sarkarverse | Sarkarverse talk | 5 |
6 | File | File talk | 7 |
8 | MediaWiki | MediaWiki talk | 9 |
10 | Template | Template talk | 11 |
12 | Help | Help talk | 13 |
14 | Category | Category talk | 15 |
100 | [[Sarkarverse:Portal|]] | [[Help:Using talk pages|]] | 101 |
108 | [[Sarkarverse:Books|]] | [[Help:Using talk pages|]] | 109 |
118 | [[Sarkarverse:Drafts|]] | [[Help:Using talk pages|]] | 119 |
446 | [[Sarkarverse:Course pages|]] | [[Help:Using talk pages|]] | 447 |
710 | [[mw:Extension:TimedMediaHandler|]] | [[Help:Using talk pages|]] | 711 |
828 | Module | Module talk | 829 |
Virtual namespaces | |||
-1 | Special | ||
-2 | Media | ||
Usage
{{NAMESPACEID}}
→ 10{{NAMESPACEID|}}
→ 0 (Article namespace){{NAMESPACEID|{{ns:0}}}}
→ 0 (Article namespace){{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
he:תבנית:מספר מרחב שם or:ଟେମ୍ପଲେଟ:NAMESPACEID
The above documentation is transcluded from Template:NAMESPACEID/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |