Template:ARTICLEROOTPAGENAME/doc: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{dochead}}{{substitute}} | {{dochead}}{{substitute}} | ||
<code>ARTICLEROOTPAGENAME</code> 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 <code style="white-space: nowrap;">{{tlx|ARTICLESPACE|plaincode}}:{{tlx|ROOTPAGENAME|plaincode}}</code>, with an additional <code style="white-space: nowrap;"><nowiki>{{</nowiki>[[mw:Help:Extension:ParserFunctions|#if: ]]<nowiki>}}</nowiki></code> statement to avoid adding a colon on pages in the main (article) namespace (where it will return {{tlx|PAGENAME}} instead). | <code>ARTICLEROOTPAGENAME</code> 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 <code style="white-space: nowrap;">{{tlx|ARTICLESPACE|plaincode}}:{{tlx|ROOTPAGENAME|plaincode}}</code>, with an additional <code style="white-space: nowrap;"><nowiki>{{</nowiki>[[mw:Help:Extension:ParserFunctions|#if: ]]<nowiki>}}</nowiki></code> statement to avoid adding a colon on pages in the main (article) namespace (where it will return {{tlx|PAGENAME}} instead). | ||
=== Options === | |||
; <code>wbr</code> | |||
: Passing <code>yes</code>, <code>y</code>, <code>true</code>, <code>t</code>, <code>on</code>, or <code>1</code> will insert a "line break opportunity" (<code><nowiki><wbr /></nowiki></code>) after the namespace's colon, to allow for a line break. | |||
=== Usage examples === | === Usage examples === | ||
| Line 9: | Line 13: | ||
! Complete page title<br />(i.e. {{tl|FULLPAGENAME}} ) !! Output of<br /><nowiki>{{ARTICLEROOTPAGENAME}}</nowiki> | ! Complete page title<br />(i.e. {{tl|FULLPAGENAME}} ) !! Output of<br /><nowiki>{{ARTICLEROOTPAGENAME}}</nowiki> | ||
|- | |- | ||
| Template:ABC || {{ARTICLEROOTPAGENAME|Template:ABC}} | | Template:ABC || {{ARTICLEROOTPAGENAME|Template:ABC|wbr=1}} | ||
|- | |- | ||
| Template:ABC/DEF || {{ARTICLEROOTPAGENAME|Template:ABC/DEF}} | | Template:ABC/DEF || {{ARTICLEROOTPAGENAME|Template:ABC/DEF}} | ||