Template:Transclude: Difference between revisions

From MC Public Wiki
Jump to navigation Jump to search
(Created page with "Template:Transclude")
 
m (1 revision)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Template:Transclude
<includeonly>{{#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 -->
    }}
}}</includeonly><noinclude>
{{/doc}}
 
[[Category:Templates]][[fr:Modèle:Transclude]]
</noinclude>

Latest revision as of 16:51, 14 October 2011


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:Transcludefr:Modèle:Transclude