Template:Transclude/sandbox: Difference between revisions
Appearance
Content deleted Content added
Numbermaniac (talk | contribs) m Reverted edits by Numbermaniac (talk) to last version by 86.159.27.117 |
Numbermaniac (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
{{#switch: {{NAMESPACE: {{{1}}} }} |
{{#switch: {{NAMESPACE: {{{1}}} }} |
||
|#default = {{FULLPAGENAME: {{{1}}} }} <!-- eg "User:Foo" --> |
|#default = {{FULLPAGENAME: {{{1}}} }} <!-- eg "User:Foo" --> |
||
|{{ns:0}} = |
|{{ns:0}} = |
||
{{#ifeq: {{NAMESPACE: {{{1}}} }} | {{NAMESPACE: Template{{{1}}} }} |
{{#ifeq: {{NAMESPACE: {{{1}}} }} | {{NAMESPACE: Template{{{1}}} }} |
||
| Template:{{{1}}} |
| Template:{{{1}}} <!-- no leading colon, eg "Foo" --> |
||
| {{PAGENAME: {{{1}}} }} |
| {{PAGENAME: {{{1}}} }} <!-- leading colon, eg ":Foo", so we want the article --> |
||
}} |
}} |
||
}}<noinclude> |
}}<noinclude> |
||
{{documentation}} |
{{documentation}} |
||
</noinclude> |
</noinclude> |
Revision as of 02:36, 22 August 2013
Template:{{{1}}}
This is the template sandbox page for Template:Transclude (diff). See also the companion subpage for test cases. |
This template is used on approximately 18,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
This template resolves page names as they would be handled by MediaWiki's page-transclusion process. It thereby removes ambiguity when doing other things with template pagenames, e.g. linking.
Usage
{{transclude| Template:Foo }}
→ Template:Foo{{transclude| Category:Foo }}
→ Category:Foo{{transclude| Foo }}
→ Template:Foo{{transclude| :Foo }}
→ Foo{{transclude| :File:Foo }}
→ File:Foo{{transclude| Project:Foo }}
→ Wikipedia:Foo
TemplateData
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Transclude in articles based on its TemplateData.
TemplateData for Transclude
This template resolves page names as they would be handled by MediaWiki's template-transclusion process. It thereby removes ambiguity when doing other things with template pagenames, e.g. linking.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Page name | 1 | The name of the page you are trying to link to | String | required |
See also
- {{Linked}}
- {{Category title}}
- {{File title}}