Forums: Index → Support Requests → "OR" Statements?
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
To contact staff directly or to report bugs, please use Special:Contact.
I've got a template that only prints a line if a variable has a value:
{{#if: {{{Variable1|}}} | The first Variable is {{{Variable1}}}.}}
Now I need to check 3 different variables, and if at least one of them have a value it should print the line. What's the best way to do this? Thanx in advnace. -Adam weiler 22:36, November 19, 2011 (UTC)
{{#if: {{{Variable1|}}}{{{Variable2|}}}{{{Variable3|}}} | Value if true}}
- This would be the easiest way - will return 'true' if any of the variables is non-empty. If you want the output to vary depending on which variable is present, your best bet would be to use nested if functions. — Sovq 23:02, November 19, 2011 (UTC)
- Or if you need some particular complicated conditions, maybe using the logical or of the expression parser function as test condition might be helpful too, read this for an explanation.
leviathan
_
89
23:15, 19 November, 2011 (UTC)
The first answer works great, thanx a lot! This page is now bookmarked. -Adam weiler 19:29, November 20, 2011 (UTC)