Similar to {{Sandbox other}} :
If the subpagename is /testcases
, returns |1=
, else |2=
.
{{Sandbox other }} — Distinguishes between the /sandbox subpages and the root template page and other subpages.
{{Testcases other }} — Distinguishes between the /testcases subpages and the root template page and other subpages.
{{Template other }} — Distinguishes between pages in the template namespace and other namespaces.
{{When on basepage }} — Distinguishes between the root template page and subpages, without special consideration in the mainspace.
{{Subpage other }} — Distinguisheds between the root page and subpages (any subpage), classifying pagenames in the mainspace with a slash as being the root page.
Namespace and pagename-detecting templates
Namespace
Particular
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
More generic
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
[[Template:{{{2}}}|{{{2}}} ]]
Pagename
[[Template:{{{2}}}|{{{2}}} ]] Detects and acts according to whether it is on a basepage or on any subpage (that is, a ../..
subpage).
[[Template:{{{2}}}|{{{2}}} ]] For pattern matching on the pagename.
Module:Page Can take apart and put together pagenames in several ways.
[[Template:{{{2}}}|{{{2}}} ]] Returns IP-user talkpage, registered-user talkpage or non-user talkpage.
[[Template:{{{2}}}|{{{2}}} ]] For detecting IP-user pages.
[[Template:{{{2}}}|{{{2}}} ]] Pagename has an after-slash part (not in mainspace)
[[Template:{{{2}}}|{{{2}}} ]] Page is subpage /sandbox (template space)
[[Template:{{{2}}}|{{{2}}} ]] Page is subpage /testcases (template space)
[[Template:{{{2}}}|{{{2}}} ]] Page is rootpage (vs. /subpage) (template space)
Others
[[Template:{{{2}}}|{{{2}}} ]] Detects whether it is on a page with a stub template or not.
[[Template:{{{2}}}|{{{2}}} ]] Detects whether it is on a redirect or not.
[[Template:{{{2}}}|{{{2}}} ]] Detects whether page is viewed as a preview or not.
[[Template:{{{2}}}|{{{2}}} ]] Displays different content to IP users and logged-in users.
[[Template:{{{2}}}|{{{2}}} ]] Displays different content to autoconfirmed and non-autoconfirmed users.
[[Template:{{{2}}}|{{{2}}} ]] Displays different content to extended confirmed and non-extended confirmed users.
[[Template:{{{2}}}|{{{2}}} ]] Displays content only to admins.
[[Template:{{{2}}}|{{{2}}} ]] Displays different content to mobile users and desktop users.
[[Template:{{{2}}}|{{{2}}} ]] Detects whether page is viewed with a JavaScript-capable client or not.