skip to Main Content
< All Articles
Print

Simple Search Field

The Simple Search form looks simple because it has only a search bar, but it is more powerful when it comes to search listings. Great thing is that you can program it yourself.

Please follow the below steps to configure it.

  1. Create a page to display search form (we will call it Search Page)
  2. Create a page to display search results (we will call it Results Page)
  3. Now Paste shortcode [rem_search_results] in Results Page
  4. Copy the URL of the Search Results page (let say its http//some_site.com/results)
  5. Paste this shortcode in Search Page [rem_simple_search results_page=”http//some_site.com/results”] (remember to replace the Results Page url with your own)
  6. That’s it, it will render a search form like this

 

By default, text written in this field will be searched in the Property Titles and Contents. But you can make it more powerful.

Making it more powerful

You can configure the settings for this simple search field here

 

In the setting field Simple Search Method, you can provide each query per line.  Each query contains the following values separated by commas respectively.

  1. text – The text you want the user to type
  2. meta_key – Meta key or field name, according to that text
  3. is_number – If the text is a number value, set it to true
  4. value – Hard-coded value, if not number.

Hope you don’t understand these 🙂 Don’t worry. I will try to explain it using examples.

Suppose we want visitors to type Rent in the search field and then display all those properties in results that have purpose set to Rent. We will provide the following query in Simple Search Method.

Rent,property_purpose

Now, when typing Rent in the search field, it will display all those properties which are for rent.

Let’s take another example,

We want users to type 2 bedrooms and then display all properties having 2 bedrooms, the following query will be used.

2 bedrooms,property_bedrooms,false,2

Wow, that’s great.

Now you may think that if you want visitors to search for 3, 4 or 5 bedrooms you may have to provide all those queries in each line like

3 bedrooms,property_bedrooms,false,3

4 bedrooms,property_bedrooms,false,4

Well, that’s not a good idea. So there is a workaround. You can set the is_number to true and then it will automatically search for the numbers provided. Let’s apply it to our above example,

bedrooms,property_bedrooms,true

Now, visitors can type 3 bedrooms, 4 bedrooms, 5 bedrooms, and the search will work accordingly.

You can also use short names, suppose you want visitors to just type 3 baths, or 4 baths or 5 baths, use following

baths,property_bathrooms,true

Pretty Cool. The good thing is that you can provide multiple queries in each line in the setting Simple Search Method, 

Example:

Rent,property_purpose
bedrooms,property_bedrooms,true
baths,property_bathrooms,true

 

Working with Multi-Language

You can allow visitors to search in their own language. Let’s take above Rent example for the German Language. We will allow users of Germany to search Miete instead of Rent to display rented properties.

Miete,property_purpose,false,rent

Shortcode Attributes

You can use the following attributes in [rem_simple_search] shortcode.

Attributes Description Default Value
placeholder Placeholder text to display in the search field Type to Search…
width Maximum width for the search bar 450px
border_color Text input border color #E4E4E4
results_page URL of the results page #
search_in Comma separated list of field names where the provided string will be searched
search_icon Search Icon <i class=”glyphicon glyphicon-search”></i>
Quick Navigation
Back To Top