Difference between revisions of "Template:If lang"

From Team Fortress Wiki
Jump to: navigation, search
m
(simplify)
Line 1: Line 1:
{{#switch:{{{logic|}}}
+
{{#ifeq:{{SUBPAGENAME}}|{{BASEPAGENAME}}|{{{1}}}|{{{2|}}}|}}<noinclude>
| no
 
| n
 
| 0
 
| false = {{#ifeq:{{SUBPAGENAME}}|{{BASEPAGENAME}}|{{{1}}}|{{{2|}}}|}}
 
| yes
 
| y
 
| 1
 
| true
 
| #default = {{#ifeq:{{SUBPAGENAME}}|{{BASEPAGENAME}}|{{{2|}}}|{{{1}}}|}}
 
}}<noinclude>
 
 
* Provides an output if the page in question is a language subpage.
 
* Provides an output if the page in question is a language subpage.
* To reverse the logic, use ''logic = false''.
+
* How it works: if the subpagename is equal to the basepagename (which is the case in English pages) then {{tl|if lang}} will output the contents of {{{1}}}.  
* Handy for instances where you need to provide an output ''if'' there is a subpage. If you need to provide an output on a ''specific'' subpage, see {{tl|lang}}.
+
** If this fails to match, {{tl|if lang}} it will output {{{2}}}.
 +
 
 
[[Category:Language templates|If lang]]
 
[[Category:Language templates|If lang]]
 
</noinclude>
 
</noinclude>

Revision as of 20:42, 11 August 2010

{{{1}}}

  • Provides an output if the page in question is a language subpage.
  • How it works: if the subpagename is equal to the basepagename (which is the case in English pages) then {{if lang}} will output the contents of {{{1}}}.
    • If this fails to match, {{if lang}} it will output {{{2}}}.