FANDOM


10

[edit] [purge] Template-info.svg Template documentation

Returns the namespace ID of page given, or of the current page.

Tractor Wiki namespaces
Basic namespaces Talk namespaces
0 Main Talk 1
2 User User talk 3
4 Tractor Wiki Tractor Wiki 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 Portal Portal talk 101
110 Forum
See Help:Wiki-style forums
Forum talk 111
 ? PML PML talk  ?
400 Video
See Help:Video Embed Tool
Video talk 401
500 User blog
See Help:Blog article
User blog comments 501
502 Blog Blog talk 503
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|TW}}Invalid namespace in {{NAMESPACEID}}
  • {{NAMESPACEID|Project}} → 4
  • {{NAMESPACEID|Tractor Wiki}}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

Community content is available under CC-BY-SA unless otherwise noted.