Template:Namespace and pagename-detecting templates
From Good Old TV Fan Wiki
Namespace and pagename-detecting templates |
---|
Namespace | |
---|
Pagename | When on basepage | Detects and acts according to whether it is on a basepage or on any subpage (that is, a ../.. subpage). |
---|
When pagename is | For pattern matching on the pagename. |
---|
Module:Page | Can take apart and put together pagenames in several ways. |
---|
IP-talk | Returns IP-user talkpage, registered-user talkpage or non-user talkpage. |
---|
IP-user other | For detecting IP-user pages. |
---|
Subpage other | Pagename has an after-slash part (not in mainspace) |
---|
Sandbox other | Page is subpage /sandbox (template space) |
---|
Testcases other | Page is subpage /testcases (template space) |
---|
|
---|
Others | Stub other | Detects whether it is on a page with a stub template or not. |
---|
If preview | Detects whether page is viewed as a preview or not. |
---|
If IP | Displays different content to IP users and logged-in users. |
---|
If autoconfirmed | Displays different content to autoconfirmed and non-autoconfirmed users. |
---|
If extended confirmed | Displays different content to extended confirmed and non-extended confirmed users. |
---|
If mobile | Displays different content to mobile users and desktop users. |
---|
|
---|
|
Initial visibility
To set the template's initial visibility, the |state=
parameter may be used:
|state=collapsed
: {{Namespace and pagename-detecting templates|state=collapsed}} to show the template collapsed, i.e., hidden apart from its title bar
|state=expanded
: {{Namespace and pagename-detecting templates|state=expanded}} to show the template expanded, i.e., fully visible
|state=autocollapse
: {{Namespace and pagename-detecting templates|state=autocollapse}}
- shows the template collapsed to the title bar if there is a {{navbar}}, a {{sidebar}}, or some other table on the page with the collapsible attribute
- shows the template in its expanded state if there are no other collapsible items on the page
If the
|state=
parameter is not set, the template's initial visibility is taken from the
|default=
parameter in the template. For this template, that currently evaluates to
autocollapse
.