Template:Transclude

From sdeevelopedia
Jump to: navigation, search

{{#switch:

|#default =  
| = 
   {{#ifeq:  | 
     | Template:{{{1}}}            
     |       
   }}

}}

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[edit]

  • {{transclude| Template:Foo }}{{#switch: Template
|#default = Template:Foo 
| = 
   {{#ifeq: Template | 
     | Template:Template:Foo            
     | Foo      
   }}

}}

  • {{transclude| Category:Foo }}{{#switch: Category
|#default = Category:Foo 
| = 
   {{#ifeq: Category | 
     | Template:Category:Foo            
     | Foo      
   }}

}}

  • {{transclude| Foo }}{{#switch:
|#default = Foo 
| = 
   {{#ifeq:  | 
     | Template:Foo            
     | Foo      
   }}

}}

  • {{transclude| :Foo }}{{#switch:
|#default = Foo 
| = 
   {{#ifeq:  | Template
     | Template::Foo            
     | Foo      
   }}

}}

  • {{transclude| :File:Foo }}{{#switch: File
|#default = File:Foo 
| = 
   {{#ifeq: File | Template
     | Template::File:Foo            
     | Foo      
   }}

}}