This site is supported by donations to The OEIS Foundation.
Template:Namespace ID/test
- This is the testing template for the {{namespace ID}} OEIS Wiki utility template. [<Edit> Template:Namespace ID]
NOTE: The Media namespace (namespace ID = -2) is disabled on OEISWiki.
Contents
Tests
Tests with namespace names
Code Result {{ns ID|media}} -2 {{ns ID|special}} -1 {{ns ID}}
{{ns ID|main}}
{{ns ID|article}}0
0
0{{ns ID|talk}}
{{ns ID|article talk}}
{{ns ID|article+}}1
1
1{{ns ID|user}} 2 {{ns ID|user talk}}
{{ns ID|user+}}
3
3
{{ns ID|project}}
{{ns ID|oeiswiki}}
4
4
{{ns ID|project talk}}
{{ns ID|project+}}
{{ns ID|oeiswiki talk}}
{{ns ID|oeiswiki+}}5
5
5
5{{ns ID|image}}
{{ns ID|file}}
6
6
{{ns ID|image talk}}
{{ns ID|image+}}
{{ns ID|file talk}}
{{ns ID|file+}}7
7
7
7{{ns ID|mediawiki}} 8 {{ns ID|mediawiki talk}}
{{ns ID|mediawiki+}}
9
9
{{ns ID|template}} 10 {{ns ID|template talk}}
{{ns ID|template+}}
11
11
{{ns ID|help}} 12 {{ns ID|help talk}}
{{ns ID|help+}}
13
13
{{ns ID|category}} 14 {{ns ID|category talk}}
{{ns ID|category+}}
15
15
{{ns ID|extras}} 100 {{ns ID|extras talk}}
{{ns ID|extras+}}
101
101
Tests with namespace abbreviations
Code Result {{ns ID|m}} -2 {{ns ID|s}} -1 {{ns ID|a}}
{{ns ID}}
0
0
{{ns ID|a+}}
{{ns ID|+}}
1
1
{{ns ID|u}} 2 {{ns ID|u+}} 3 {{ns ID|p}}
{{ns ID|ow}}
4
4
{{ns ID|p+}}
{{ns ID|ow+}}
5
5
{{ns ID|i}}
{{ns ID|f}}
6
6
{{ns ID|i+}}
{{ns ID|f+}}
7
7
{{ns ID|mw}} 8 {{ns ID|mw+}} 9 {{ns ID|t}} 10 {{ns ID|t+}} 11 {{ns ID|h}} 12 {{ns ID|h+}} 13 {{ns ID|c}} 14 {{ns ID|c+}} 15 {{ns ID|e}} 100 {{ns ID|e+}} 101
Tests with namespace IDs
Code Result {{ns ID|-2}} -2 {{ns ID|-1}} -1 {{ns ID|0}} 0 {{ns ID|1}} 1 {{ns ID|2}} 2 {{ns ID|3}} 3 {{ns ID|4}} 4 {{ns ID|5}} 5 {{ns ID|6}} 6 {{ns ID|7}} 7 {{ns ID|8}} 8 {{ns ID|9}} 9 {{ns ID|10}} 10 {{ns ID|11}} 11 {{ns ID|12}} 12 {{ns ID|13}} 13 {{ns ID|14}} 14 {{ns ID|15}} 15 {{ns ID|100}} 100 {{ns ID|101}} 101
Namespaces
With the ns: parser function we get namespace name (empty string for article (Main) default namespace) from namespace ID
Code Result {{ns:-2}} Media {{ns:-1}} Special {{ns:0}} {{ns:1}} Talk {{ns:2}} User {{ns:3}} User talk {{ns:4}} OeisWiki {{ns:5}} OeisWiki talk {{ns:6}} File {{ns:7}} File talk {{ns:8}} MediaWiki {{ns:9}} MediaWiki talk {{ns:10}} Template {{ns:11}} Template talk {{ns:12}} Help {{ns:13}} Help talk {{ns:14}} Category {{ns:15}} Category talk {{ns:100}} Extras {{ns:101}} Extras talk
Wiki variables
NOTE: The Media namespace ({{namespace ID|Media}} = −2) is disabled on OEIS Wiki.
See the original version of this template on:
Template:Wikivar—Wikimedia Commons (commons: prefix). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Code
<noinclude>{{Documentation}}</noinclude><includeonly>{{#switch: {{lc: {{#replace: {{{1|}}} |_| }} }} <!-- underscore replaced by space --> | media | m | -2 = -2 <!-- Media --> | special | s | -1 = -1 <!-- Special --> | main | a | 0 = 0 | article = 0 | = 0 <!-- {{MediaWiki:Blanknamespace}} = (Main) --> | talk | a+ | 1 = 1 | article talk = 1 | + = 1 | article+ = 1 <!-- Talk --> | user | u | 2 = 2 <!-- User --> | user talk | u+ | 3 = 3 | user+ = 3 <!-- User talk --> | project | p | 4 = 4 | oeiswiki = 4 | ow = 4 <!-- OeisWiki --> | project talk | p+ | 5 = 5 | oeiswiki talk = 5 | ow+ = 5 | project+ = 5 | oeiswiki+ = 5 <!-- OeisWiki talk --> | image | i | 6 = 6 | file = 6 | f = 6 <!-- File --> | image talk | i+ | 7 = 7 | file talk = 7 | f+ = 7 | image+ = 7 | file+ = 7 <!-- File talk --> | mediawiki | mw | 8 = 8 <!-- MediaWiki --> | mediawiki talk | mw+ | 9 = 9 | mediawiki+ = 9 <!-- MediaWiki talk --> | template | t | 10 = 10 <!-- Template --> | template talk | t+ | 11 = 11 | template+ = 11 <!-- Template talk --> | help | h | 12 = 12 <!-- Help --> | help talk | h+ | 13 = 13 | help+ = 13 <!-- Help talk --> | category | c | 14 = 14 <!-- Category --> | category talk | c+ | 15 = 15 | category+ = 15 <!-- Category talk --> | extras | e | 100 = 100 <!-- Extras --> | extras talk | e+ | 101 = 101 | extras+ = 101 <!-- Extras talk --><!-- --> | #default = {{error| Namespace ID error: Invalid namespace }} }}
Notes
- ↑ 1.0 1.1 The Media namespace ({{namespace ID|Media}} = −2) is disabled on OEIS Wiki.
- ↑ Returns empty string.
- ↑ 3.0 3.1 Always show 2 digits (with leading 0 if required).
- ↑ See {{basepage name}}.
- ↑ 5.0 5.1 5.2 5.3 5.4 URL encoded version.
- ↑ See {{basepage name|e}}.
- ↑ See {{subpage name}}.
- ↑ See {{subpage name|e}}.
- ↑ Revision ID of the current page (changes with each saved edit).