I've got an icon that defines a country. When this icon is clicked on, i would like to show only the users based on this city(for example New York)
How can i arange/fix this?
[ed. note: stevebravo last edited this post 13 years, 10 months ago.]
can somebody help me plz?
can somebody help me plz?
-
☆ A M B ☆
- 24,524 Posts
Well, for one thing New York is not a country. That makes it a little unclear exactly what it is you are trying to do.
-
☆ A M B ☆
- 24,524 Posts
The "Peoples" snippet is what you need. It has a "where" property (not mentioned in the rtfm, but is in the snippet code) that you should be able to use to specify the city (city = "New York"). How you pass the selected city to the snippet property is another matter. There are several ways to handle that; I'd be inclined to use AJAX and have the Peoples snippet be the AJAX request processor.
i looked around. but how do i use the "where" property?
-
☆ A M B ☆
- 24,524 Posts
I would presume something like &where=`'array(city'=>'Los Angles')` or &where=`{'city':'Los Angles'}`
It can be an array or a JSON string.
http://rtfm.modx.com/display/xPDO20/xPDOQuery.where
http://rtfm.modx.com/display/xPDO20/fromJSON
from the snippet.peoples.php file line 40
$where = $modx->getOption('where',$scriptProperties,'');
Then line 70
if (!empty($where)) {
$where = is_array($where) ? $where : $modx->fromJSON($where);
$c->where($where);
}