Le 02/04/2012 16:49, Serge Markitanenko a écrit :
I make an array in url, but I have the same matter, if I access the
/rubrique7
there is no array in this url so the result is correct !
An url with a non empty array would possibly look like
/rubrique7?id_mot=12&id_mot=1
JLuc
and use any of these boucles
<BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #ENV{id_mot}>
<BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #GET{id_mot}>
<BOUCLE_list(ARTICLES) {id_rubrique}{id_mot ?IN #ENV**{id_mot}>
I see current sql query
AND (articles.id_rubrique = 7)
AND ((L1.id_mot IN ('')))
And as the result it display none (((
Is any other idea? Would be very gladfull )))
Best regards,
Serge
30 марта 2012 г. 16:35 пользователь JLuc <jluc@no-log.org <mailto:jluc@no-log.org>> написал:
Le 30/03/2012 12:15, Serge Markitanenko a écrit :
I'm trying to display the articles with 2 different keyword.
The main matter that keywords could be defined or undefined - see the links:
/rubrique7&id_mot1=9
/rubrique7&id_mot1=9&id_mot2=11
/rubrique7&id_mot2=11
/rubrique7
I'm trying to do this via
<BOUCLE_list(ARTICLES) {id_mot ?IN #ENV{id_mot1}, #ENV{id_mot2} }>
....
</BOUCLE_list>
But this work correct only if all two mots are difined.
Is any ideas?
You'd be better of preparing an array variable before
that would contain 0, 1 or 2 mots values,
and testing IN #GET{the_array}
Or read once more the documentation of the IN critere :
"It is similarly possible to pass an array as an argument (from SPIP 1.9 onwards).
This can be an array defined by an #ARRAY tag or perhaps an array originating from a #ENV**{my_post} tag.
If #ENV{my_post} is an array (originating perhaps from form entries where the name attribute ends in ), and if the
analysis filters have been deactivated by adding a double asterisk to this tag, then each element of the array will
be considered as an argument for IN, SPIP applying the security filters to each of them in turn [1]."
So if you choose to use such urls :
> /rubrique7&id_mot=9
> /rubrique7&id_mot=9&id_mot=11
> /rubrique7&id_mot=11
> /rubrique7
it says you should be able tu use {id_mot IN #ENV{id_mot}}
or maybe {id_mot ?IN #ENV{id_mot}}
or rather {id_mot ?IN #ENV**{id_mot}} according on this documentation.
JLuc
_______________________________________________
spip-en@rezo.net <mailto:spip-en@rezo.net> -
http://listes.rezo.net/mailman/listinfo/spip-en