Template:Transclude: Difference between revisions
Jump to navigation
Jump to search
WikiMaster (talk | contribs) (Create template from source: http://meta.wikimedia.org/wiki/Template:Transclude) |
WikiMaster (talk | contribs) (Updated to Template:Transclude sourced from here: http://en.wikipedia.org/wiki/Template:Transclude) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{# | {{#switch: {{NAMESPACE: {{{1}}} }} | ||
{{documentation}}</noinclude> | |#default = {{FULLPAGENAME: {{{1}}} }} <!-- eg "User:Foo" --> | ||
|{{ns:0}} = | |||
{{#ifeq: {{NAMESPACE: {{{1}}} }} | {{NAMESPACE: Template{{{1}}} }} | |||
| Template:{{{1}}} <!-- no leading colon, eg "Foo" --> | |||
| {{PAGENAME: {{{1}}} }} <!-- leading colon, eg ":Foo", so we want the article --> | |||
}} | |||
}}<noinclude> | |||
{{documentation}} | |||
</noinclude> |
Latest revision as of 20:08, 21 March 2012
Template:{{{1}}}
This template produces the full name of the page transcluded if a name is put in double braces.
Parameter without namespace prefix:
Parameter with namespace prefix:
Internal details
{{NAMESPACE:{{{1}}}}}
determines the namespace prefix without colon; it is empty both if the parameter has no prefix at all, and if it starts with a colon. To distinguish these two cases, {{NAMESPACE:Template{{{1}}}}}
is considered: if that is empty the parameter does not start with a colon.
See also
The above documentation is transcluded from Template:Transclude/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |