[MediaWiki-l] "AND" conditions when asking about tmeplate arguments

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[MediaWiki-l] "AND" conditions when asking about tmeplate arguments

Marcelo Chiaradía
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.
_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: "AND" conditions when asking about tmeplate arguments

Bartosz Dziewoński
Just nest the ifs? There is not built-in way.

--
Matma Rex

_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: "AND" conditions when asking about tmeplate arguments

Marcelo Chiaradía
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 <[hidden email]>

> Just nest the ifs? There is not built-in way.
>
> --
> Matma Rex
>
> ______________________________**_________________
> MediaWiki-l mailing list
> [hidden email].**org <[hidden email]>
> https://lists.wikimedia.org/**mailman/listinfo/mediawiki-l<https://lists.wikimedia.org/mailman/listinfo/mediawiki-l>
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: "AND" conditions when asking about tmeplate arguments

Brion Vibber
On Fri, Jul 5, 2013 at 12:50 PM, Marcelo Chiaradía <
[hidden email]> 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 mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l