Hi Rachel,
Basically, I created a page with a form with multiple fields, and the form action was to the search results page. The search results page contains a call to the snippet that displays the results.
<p>[!SearchEvents? !]</p>
The snippet itself is fairly simple, and gets the data passed to it like so:
$kw = clean ( $_REQUEST["keywords"] );
$ct = clean ( $_REQUEST["city"] );
// and so on...
I have a php function in the code to sanitize the input:
// clean data function
function clean ($data) {
// cleans data from user input
$cleanoutput = mysql_escape_string (htmlentities( stripslashes($data) ) );
return $cleanoutput;
}
Then later in the snippet, I have code blocks that look like this:
// process city if exists
if( !empty($ct) ) {
if ( empty($filter) ) {
$filter .= "";
}
else {
$filter .= "|";
}
$filter .= "EventCity," . $ct . ",9";
}
// and so on for each of the others
And then finally, I have ditto do the search with the built-up filter from above.
// run ditto
return $modx->runSnippet(
'Ditto',
array(
'parents'=>'150',
'tpl'=>'SearchEvents_tpl',
'depth'=>'0',
'filter'=>$filter,
'noResults'=>'no results',
'seeThruUnpub'=>'1',
'caseSensitive'=>'0',
)
);
There you go, Rachel. This should get you up and running.
Let me know if you have any questions.
Cheers!