Template:ARTICLEROOTPAGENAME/doc: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
m Wording to clarify
ArrowHead294 (talk | contribs)
mNo edit summary
Line 1: Line 1:
{{dochead}}
{{dochead}}
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 full page name otherwise. It is equivalent to <code>{{[[mw:Help:Magic words#Namespaces|ARTICLESPACE]]<nowiki>}}:{{</nowiki>[[mw:Help:Magic words#Namespaces|ROOTPAGENAME]]}}</code>, with an additional <code>{{<nowiki />#if:}}</code> statement to avoid adding a colon on regular pages.
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 full page name otherwise. It is equivalent to <code><nowiki>{{</nowiki>[[mw:Help:Magic words#Namespaces|ARTICLESPACE]]<nowiki>}}:{{</nowiki>[[mw:Help:Magic words#Namespaces|ROOTPAGENAME]]<nowiki>}}</nowiki></code>, with an additional <code><nowiki>{{</nowiki>[[mw:Help:Extension:ParserFunctions|#if:&nbsp;]]<nowiki>}}</nowiki></code> statement to avoid adding a colon on pages in the main (article) namespace.
 
=== Examples ===
{| class="wikitable"
|-
! Full page name !! Output
|-
| Template:ABC || rowspan="4" | Template:ABC
|-
| Template:ABC/DEF
|-
| Template talk:ABC
|-
| Template talk:ABC/DEF
|-
| ABC/DEF || ABC/DEF
|}

Revision as of 16:26, 7 March 2025

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 full page name otherwise. It is equivalent to {{ARTICLESPACE}}:{{ROOTPAGENAME}}, with an additional {{#if: }} statement to avoid adding a colon on pages in the main (article) namespace.

Examples

Full page name Output
Template:ABC Template:ABC
Template:ABC/DEF
Template talk:ABC
Template talk:ABC/DEF
ABC/DEF ABC/DEF