Search Form Customization Print

  • 0

The RWS IDX Plugin has a number of search form functions that will automate the display of selectable options for search filters. These “built-in” functions can speed up the search form customizations and reduce coding.


Boolean AND/OR Queries

Search filters include boolean AND/OR queries. AND queries require all filters to be true. If all the AND filters do not return true, then the search result will be empty. OR queries require only one filter to return true. If all the OR filters do not return true, then the search result will return those filters that do return true. Each selectable field is an AND filter. Using multiple select dropdown, an individual field can become an OR filter relating the items selected within the same select dropdown.


Sending Search Queries

Search form queries are sent using GET values. The GET queries will appear in the URL as a query string. Search results can be updated simply by changing the url query string. The query string must be appended to the search page url. Enabling debug mode will display the query being sent to the RWS API server.


URL Query String Example: http://yourdomain.com/search-listings/?property_type_code=Residential&city=Naples&price-max=200000     


Types of Filters      

AND Filter - Basic filter will perform an AND query.

Example: property_type_code=Residential&county=Collier

 

OR Filter - Appending “_or[]” to the filter name will perform an OR query with the same filter name.

Example: prop_type_description_or[]=High+Rise+(8%2B)&prop_type_description_or[]=Low+Rise+(1-3)&prop_type_description_or[]=Mid+Rise+(4-7)


EOR Filter - Appending “_eor[]” to the filter name will perform an OR LIKE match query with the same filter name. LIKE matches are similar to wildcard searches.

Example: prop_type_description_eor[]=High+Rise+(8%2B)&prop_type_description_eor[]=Low+Rise+(1-3)&prop_type_description_eor[]=Mid+Rise+(4-7)


LIKE Filter - Appending “_like” to the filter name will perform a LIKE match query with the same filter name. LIKE matches are similar to wildcard searches.

Example: prop_type_description_like=Villa


MIN/MAX Filter - Appending “-min” or “-max” to the filter name will perform a range filter. This is ideal for integer values like Price, Building SQFT, Year Built or number of garages.   


Search Form Input Examples

As mentioned previously, the search form uses GET method to submit the form values to the RWS API Server. Using the “search_form.php” override file, the search form can be easily customized. Any html form input will work, but the plugin already has functions that will speed up the search form customizations.


These examples include the jQuery Chosen plugin. Please refer to the Chosen plugin documentation for customizing the select inputs, http://harvesthq.github.io/chosen/.

    

Basic Text Input:

<input name="mls_num" class="text_input" value="" size="25" placeholder="Enter Property MLS Number" type="text">


Single Select with Auto-generated Option List:

<select name="county" data-placeholder="Choose a County..." class="chosen-select">

<?php echo rws_idxCommon::select_options("county",$search['county']); ?>

</select>


Multiselect with Auto-generated Option List:

<select name="mls_area_or[]" data-placeholder="Choose a Area..." class="chosen-select" multiple>

<?php echo rws_idxCommon::select_options("mls_area",$search['mls_area_or']); ?>

</select>

Note: This multiselect requires an OR query. The OR query is added by editing the input name like this “mls_area_or[]”


Single Select for MIN Price:

<select name="price-min" data-placeholder="Min Price" class="chosen-noselect">

<?php echo rws_idxListing::price_options("price-min",$search['price-min']); ?>

</select>


Single Select for MAX Price:

<select name="price-max" data-placeholder="Max Price" class="chosen-noselect">

<?php echo rws_idxListing::price_options("price-max",$search['price-max']); ?>

</select>



Single Select for MIN SQFT:

<select name="building_sqft-min" data-placeholder="Min Sqft" class="chosen-noselect">

<?php echo rws_idxListing::sf_options("building_sqft-min",$search['building_sqft-min']); ?>

</select>


Single Select for MAX SQFT:

<select name="building_sqft-max" data-placeholder="Max Sqft" class="chosen-noselect">

<?php echo rws_idxListing::sf_options("building_sqft-max",$search['building_sqft-max']); ?>

</select>


Single Select for MIN Year Built:

<select name="year-min" data-placeholder="Min year" class="chosen-noselect">

<?php echo rws_idxListing::year_options("year-min",$search['year-min']); ?>

</select>


Single Select for MAX Year Built:

<select name="year-max" data-placeholder="Max year" class="chosen-noselect">

<?php echo rws_idxListing::year_options("year-max",$search['year-max']); ?>       

</select>


Single Select for Integers:

<select name="baths_full" data-placeholder="Baths" class="chosen-noselect">

<?php echo rws_idxListing::select_numeric(10,$search['baths_full']); ?>

</select>

Note: This function requires that you specify the max value to auto generate the the option list. Ideal for numeric values like full bathrooms, unit floor or number of carports.


Single Select for Property Type:

<select name="property_type_code" data-placeholder="Property Type" class="chosen-noselect">

<?php echo rws_idxListing::select_ptype("property_type_code",$search['property_type_code']); ?>

</select>

Note: This select uses the “views/idx_ptypes.php” to produce the option list.


Single Select for City:

<select name="city" data-placeholder="Choose a City..." class="chosen-select">

<?php echo rws_idxListing::select_city(FALSE,$search['city']); ?>

</select>

Note: This select uses the “views/idx_cities.php” to produce the option list.


Single Select for Zip Code:

<select name="zip_code" data-placeholder="Choose a Zip Code..." class="chosen-select">

<?php echo rws_idxListing::select_zipcode("zip_code",$search['zip_code']); ?>

</select>


Multiselect for Property Features:  

<?php echo rws_idxListing::display_allfeatures($search['Features1']); ?>

Note: FAR IDX Only. This function will not work with the RETS data. This select uses the "views/idx_features.php" to produce the option list and the "views/idx_features_cat.php" to produce the category groups.


Was this answer helpful?

« Back