Fyrimynd:NAMESPACEID
10
Henda fyrimynd verður nýtt in Template:Editnotice load/core. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid large-scale disruption, any changes should first be tested in this template's /sandbox or /testcases subpage, or in your own user space. The tested changes can then be added in one single edit to this template. Please discuss any changes at the talk page before implementing them. |
Uses Lua: |
Returns the namespace ID of page given, or of the current page.
Wikipedia namespaces | |||
---|---|---|---|
Subject namespaces | Talk namespaces | ||
0 | (Høvuðs/Grein) | Kjak | 1 |
2 | Brúkari | Brúkarakjak | 3 |
4 | Wikipedia | Wikipedia-kjak | 5 |
6 | Mynd | Myndakjak | 7 |
8 | MediaWiki | MediaWiki-kjak | 9 |
10 | Fyrimynd | Fyrimyndakjak | 11 |
12 | Hjálp | Hjálparkjak | 13 |
14 | Bólkur | Bólkakjak | 15 |
100 | [[Wikipedia:Portalur|]] | 101 | |
108 | [[Wikipedia:Books|]] | 109 | |
118 | [[Wikipedia:Drafts|]] | 119 | |
446 | [[Wikipedia:Course pages|]] | 447 | |
710 | TimedText | TimedText talk | 711 |
828 | Module | Module talk | 829 |
2300 | [[Wikipedia:Gadgets|]] | 2301 | |
2302 | [[Wikipedia:Gadgets|]] | 2303 | |
2600 | [[Wikipedia:Flow|]] | ||
Virtuel navnarúm | |||
-1 | Serstakt | ||
-2 | Miðil |
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}}
→ 4{{NAMESPACEID|Project}}
→ 4{{NAMESPACEID|Wikipedia}}
→ 4
Invalid input returns an error, which can be caught with the #iferror parser function:
{{NAMESPACEID|Foo}}
→ Invalid namespace in {{NAMESPACEID}}
See also
Dokumentatiónin omanfyri er tikin frá Fyrimynd:NAMESPACEID/doc. (rætta | søga) Editors can experiment in this template's sandkassi (upprætta | mirror) and testcases (upprætta) pages. Please add categories to the /doc subpage. Undirsíður til hesa/hetta fyrimyndina. |