Template:ARTICLEROOTPAGENAME: Difference between revisions
Jump to navigation
Jump to search
ArrowHead294 (talk | contribs) m Safesubst with noinclude has to be used on everything |
ArrowHead294 (talk | contribs) mNo edit summary |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{safesubst:< | {{<includeonly>safesubst:</includeonly>#if: {{{1|}}}|{{<includeonly>safesubst:</includeonly>#if: {{<includeonly>safesubst:</includeonly>ARTICLESPACE:{{{1|}}}}}|{{<includeonly>safesubst:</includeonly>ARTICLESPACE:{{{1}}}}}:{{<includeonly>safesubst:</includeonly>#ifeq: {{<includeonly>safesubst:</includeonly>yesno|{{{wbr|}}}}}|true|​|}}{{<includeonly>safesubst:</includeonly>ROOTPAGENAME:{{{1}}}}}|{{<includeonly>safesubst:</includeonly>PAGENAME:{{{1}}}}}}}|{{<includeonly>safesubst:</includeonly>#if: {{<includeonly>safesubst:</includeonly>ARTICLESPACE}}|{{<includeonly>safesubst:</includeonly>ARTICLESPACE}}:{{<includeonly>safesubst:</includeonly>#ifeq: {{<includeonly>safesubst:</includeonly>yesno|{{{wbr|}}}}}|true|​|}}{{<includeonly>safesubst:</includeonly>ROOTPAGENAME}}|{{<includeonly>safesubst:</includeonly>PAGENAME}}}}}}<noinclude> | ||
{{documentation}} | {{documentation}} | ||
[[Category:Magic word templates]] | [[Category:Magic word templates]] | ||
</noinclude> | </noinclude> |
Latest revision as of 17:55, 1 July 2025
Template:ARTICLEROOTPAGENAME
![]() |
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
, with an additional {{ARTICLESPACE}}
:{{ROOTPAGENAME}}
{{#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
, or1
to insert a zero-width space character (U+200B,​
) 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:ABC |
Template:ABC/DEF | Template:ABC |
Template talk:ABC | Template:ABC |
Template talk:ABC/DEF | Template:ABC |
ABC | ABC |
Talk:ABC | ABC |
ABC/DEF | ABC/DEF |
Talk:ABC/DEF | ABC/DEF |