Jump to content

Template talk:If equal 6

Add topic
From Meta, a Wikimedia project coordination wiki

This template is like Template:If equal g, but with three extra parameters. Among other things, this allows calling a template with three given parameters, or calling the same template with another set of three, depending on the condition, provided that an auxiliary template is prepared that calls the other one with the 4th, 5th and 6th parameter of the former as values for the 1st, 2nd and 3rd parameter of the latter.

Example:

Using Template:t2 containing "Parameter 1 is "{{{1}}}", parameter 2 is "{{{2}}}"<noinclude>[[Category:Demo template]]</noinclude>" and Template:t2 shifted containing "{{t2|{{{4}}}|{{{5}}}|{{{6}}}}}",

{{if equal 6|t2|t2 shifted||d|a|b|c|d|e|f}}

gives:

Parameter 1 is "d", parameter 2 is "e"


{{if equal 6|t2|t2 shifted|||a|b|c|||}}

gives:

Parameter 1 is "a", parameter 2 is "b"


Thus a, b, and c function as default values for d, e, and f.