Hello people:
In advance, I apologize to write in (a not so good) English.
I'm working in a site wich is a kind of portal to publish properties
for rent or sell.
http://www.ph-cordoba.com/spip.php
I've made a heavy use of keywords and #ENV to filter by conditionals
keywords , you can take a look at ./squelettes
In short, every article has at least 1 keyword (from group "tipo"),
so I check all others variables, and if it's empty, I use the keyword
from 'tipo' instead (wich means a double definition of the same
criteria id_mot=XX, or in other words, ignore the missing 'barrio'
argument and show items from all of them)
[(#ENV{barrio}|!={"no"}|?{#SET{barrio,#ENV{barrio}},#SET{barrio,#ENV{tipo}}})]
<BOUCLE_items(ARTICLES){id_mot=#ENV{tipo}}{id_mot=#GET{barrio}}>
...
</BOUCLE_items>
This is working, but I need more details.. so I think use 'champs
extra'. But.. it is possible to use 'champs extra' like a loop's
criteria? if not, should be hard made it possible?
for example, I would like define a field 'price', to compare with a
range (between 'min' and 'max') defined by the users.
By the way, it's possible to define a only numerical champ extra?
thanks.
Martin
Hello
You have to use the plugin Champs homonymes.
It links the champs extra to a field with the same name in Spip tables.
So you can use the posibility of the champs extra to update it in the private site
and the possibility of Spip 1.9 to manage the SQL tables (loop’s criteria)…
http://monsitespip.com/spip.php?article7
jmv
----- Original Message -----
From: Martín Gaitán
To: spip@rezo.net
Sent: Tuesday, July 31, 2007 8:53 AM
Subject: [Spip] champs extra as criteria of loops
Hello people:
In advance, I apologize to write in (a not so good) English.
I’m working in a site wich is a kind of portal to publish properties
for rent or sell.
http://www.ph-cordoba.com/spip.php
I’ve made a heavy use of keywords and #ENV to filter by conditionals
keywords , you can take a look at ./squelettes
In short, every article has at least 1 keyword (from group « tipo »),
so I check all others variables, and if it’s empty, I use the keyword
from ‹ tipo › instead (wich means a double definition of the same
criteria id_mot=XX, or in other words, ignore the missing ‹ barrio ›
argument and show items from all of them)
[(#ENV{barrio}|!={« no »}|?{#SET{barrio,#ENV{barrio}},#SET{barrio,#ENV{tipo}}})]
<BOUCLE_items(ARTICLES){id_mot=#ENV{tipo}}{id_mot=#GET{barrio}}>
…
</BOUCLE_items>
This is working, but I need more details… so I think use ‹ champs
extra ›. But… it is possible to use ‹ champs extra › like a loop’s
criteria? if not, should be hard made it possible?
for example, I would like define a field ‹ price ›, to compare with a
range (between ‹ min › and ‹ max ›) defined by the users.
By the way, it’s possible to define a only numerical champ extra?
thanks.
Martin
liste spip
spip@rezo.net - désabonnement : spip-off@rezo.net
Infos et archives : http://listes.rezo.net/mailman/listinfo/spip
Documentation de SPIP : http://www.spip.net/
irc://irc.freenode.net/spip
FAQ : http://www.spip-contrib.net/spikini/FaQ
2007/7/31, Jean-Marc Viglino <jean-marc.viglino@ign.fr>:
Hello
You have to use the plugin Champs homonymes.
http://monsitespip.com/spip.php?article7
jmv
thanks Jean. I think it'll be useful.