Template:ARTICLEROOTPAGENAME: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
Undid revision 186062 by ArrowHead294 (talk)
Tag: Undo
Line 1: Line 1:
<onlyinclude>{{<includeonly>safesubst:<noinclude /> </includeonly>#if: {{ARTICLESPACE}}|{{ARTICLESPACE}}:{{ROOTPAGENAME}}|{{PAGENAME}}}}</onlyinclude>
<onlyinclude>{{<includeonly>safesubst:</includeonly>#if: {{ARTICLESPACE}}|{{ARTICLESPACE}}:{{ROOTPAGENAME}}|{{PAGENAME}}}}</onlyinclude>
{{documentation}}
{{documentation}}


[[Category:Magic word templates]]
[[Category:Magic word templates]]

Revision as of 15:31, 14 March 2025

Template:ARTICLEROOTPAGENAME

Template documentation[view] [edit] [history] [purge]
This template may be substituted.

ARTICLEROOTPAGENAME is a pseudo-magic word that returns the associated content namespace (e.g. "Template" if used on a page in the "Template" or "Template talk" namespace), followed by the root of the page name in namespaces where automatic subpages are enabled, or the page name without the namespace otherwise. It is equivalent to {{ARTICLESPACE}}:{{ROOTPAGENAME}}, with an additional {{#if: }} statement to avoid adding a colon on pages in the main (article) namespace (where it will return {{PAGENAME}} instead).

Options

wbr
Pass yes, y, true, t, on, or 1 to insert a zero-width space character (U+200B, &ZeroWidthSpace;) after the namespace's colon, to allow for a line break.

Usage examples

The table below shows live usage examples.

Complete page title
(i.e. {{FULLPAGENAME}} )
Output of
{{ARTICLEROOTPAGENAME}}
Template:ABC Template:ARTICLEROOTPAGENAME
Template:ABC/DEF Template:ARTICLEROOTPAGENAME
Template talk:ABC Template:ARTICLEROOTPAGENAME
Template talk:ABC/DEF Template:ARTICLEROOTPAGENAME
ABC Template:ARTICLEROOTPAGENAME
Talk:ABC Template:ARTICLEROOTPAGENAME
ABC/DEF Template:ARTICLEROOTPAGENAME
Talk:ABC/DEF Template:ARTICLEROOTPAGENAME