<div id="search_container"> <form action="[[~21]]" method="get" name="search" class="clearfix"> <h2>Seach</h2> <fieldset id="form_type"> <select name="proptype"> <option value="Office">Office</option> <option value="Industrial">Industrial</option> <option value="Retail">Retail</option> <option value="Multifamily">Multifamily</option> <option value="Land">Land</option> </select><br/><br/> <select name="proploc"> <option value="Metro Area">Metro Area</option> <option value="Arapahoe County">Arapahoe County</option> <option value="Adams County">Adams County</option> <option value="Jefferson County">Jefferson County</option> <option value="Arvada">Arvada</option> <option value="Aurora">Aurora</option> <option value="Centennial">Centennial</option> <option value="Denver">Denver</option> <option value="Lakewood">Lakewood</option> <option value="Littleton">Littleton</option> <option value="Westminister">Westminister</option> <option value="Wheat Ridge">Wheat Ridge</option> </select><br/><br/> <input type="radio" name="propfor" value="Lease"> Lease OR <input type="radio" name="propfor" value="Purchase"> Purchase<br/><br/> </fieldset> <input type="submit" value="Search" name="searchButton" /> </form> </div>
<?php
$proptype = $modx->getOption('proptype',$_REQUEST,'');
$proploc = $modx->getOption('proploc',$_REQUEST,'');
$propfor = $modx->getOption('propfor',$_REQUEST,'');
$wheres = array();
if (!empty($proptype)){
$wheres[] = array('proptype' => $proptype);
}
if (!empty($proploc)){
$wheres[] = array('proploc' => $proploc);
}
if (!empty($propfor)){
$wheres[] = array('propfor' => $propfor);
}
$config['where'] = $modx->toJson($wheres);
?><header id="site_header"> Property Search Results </header> <div id="content" role="main"> <h1>[[*longtitle]]</h1> [[!bloX? &packagename=`propertylistings` &limit=`0` &classname=`propertylistings` &configs=`propsearch` &tpls=`bloxouter:gcgBloxOuterTpl||row:gcgBloxRowTpl` &debug=`0`]] </div>
This question has been answered by Bruno17. See the first response.
Does it generate the correct url to your landing-page?
<form action="index.php?id=21" method="get" name="search" class="clearfix">
<input type="hidden" name="id" value="21" />
I think, it should work, as soon, as you switch FURLs on, or try to put a hidden field to your search form:
<input name="id" value="21" type="hidden">
I think, it should work, as soon, as you switch FURLs on, or try to put a hidden field to your search form:
<input name="id" value="21" type="hidden">
set &debug=`1` in your blox-call and we should see the generated sql
Metro Area||Jefferson County||Denver||Wheat Ridge
if (!empty($proploc)){
$wheres[] = array('proploc:LIKE' => '%' . $proploc . '%');
}I see you have multiple proplocs like
Metro Area||Jefferson County||Denver||Wheat Ridge
is this correct?
Than you can try this:
if (!empty($proploc)){ $wheres[] = array('proploc:LIKE' => '%' . $proploc . '%'); }