Template:Transclude: Difference between revisions

From MC Public Wiki
Jump to navigation Jump to search
(Created page with "Template:Transclude")
 
No edit summary
Line 1: Line 1:
Template:Transclude
{{#switch: {{NAMESPACE: {{{1}}} }}
|#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>

Revision as of 04:29, 5 January 2011

Template:{{{1}}}

Documentation icon Template documentation[view] [edit] [history] [purge]

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.

Key usage is in navboxes' view, discuss, edit (v,d,e) menu.

Usage

  • {{transclude| Template:Foo }}Template:Foo
  • {{transclude| Category:Foo }}Category:Foo
  • {{transclude| Foo }}Template:Foo
  • {{transclude| :Foo }}Foo
  • {{transclude| :File:Foo }}File:Foo

See also

ar:قالب:Transclude et:Mall:Transclude fa:الگو:Transclude gu:ઢાંચો:Transclude id:Templat:Transclude ja:Template:Transclude pt:Predefinição:Transclude