Hello everyone,
Im using the "#if:" parser function to ask about my template arguments.
I need to make an "AND" condition when asking about them, something like this:
{{#if: {{{p1|}}} and {{{p2|}}} and {{{p3|}}} | MY_TEXT }}
but is not working.
Im aware that "OR" conditions are posibles just placing one argument besides the other, like this:
{{#if: {{{p1|}}} {{{p2|}}} {{{p3|}}} | MY_TEXT }}
Is there some funcionality to make "AND" conditions? Ive been googling it and didnt fount anything.
Thanks a lot in advance,
Marcelo.
Yes, I thought of that possibility, but I have to ask about 5 arguments, and the code will get really awful with nested ifs.
It is weird why there's no built-in way for "ands" and yes for "ors".
2013/7/5 Bartosz Dziewoński matma.rex@gmail.com
Just nest the ifs? There is not built-in way.
-- Matma Rex
______________________________**_________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.**org MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/mediawiki-lhttps://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On Fri, Jul 5, 2013 at 12:50 PM, Marcelo Chiaradía < chiaradiamarcelo@gmail.com> wrote:
Yes, I thought of that possibility, but I have to ask about 5 arguments, and the code will get really awful with nested ifs.
It is weird why there's no built-in way for "ands" and yes for "ors".
If you want more complex logic than the classic template system allows for, you may be better off using Lua scripting. This is provided by the Scribunto extension: https://www.mediawiki.org/wiki/Extension:Scribunto
-- brion
mediawiki-l@lists.wikimedia.org