Difference between revisions of "User:Ericb/Ifeq"
From MHWiki
(another new template) |
(No difference)
|
Revision as of 13:00, 24 October 2011
A conditional template. The first two arguments must be simple names, appropriate for named parameters of a template, or empty. If they match, then we end up calling the {{Use}} template with the indirect argument named twice, so the overall expansion is our third argument. But if they differ, then we end up using {{Use}} with the indirect argument named only once, so the overall expansion is our fourth argument.
That is, I implemented {{#ifeq:test1|test2|if equal|if differ}}, with a slightly different syntax:
{{ifeq|test1|test2|if equal|if differ}}