Search Form
Default Shortcode
Following is the default shortcode to render the property search form.
[rem_search_property]
It will display the following fields in 2 columns layout.
- Search Text
- Address
- Property Type
- Property Country
- Property Purpose
- Price slider
Custom Search Fields
You can manage fields in search form using the fields_to_show attribute. It accepts field names separated by commas. The following shortcode will display only Property Type and Purpose dropdowns in the search form.
[rem_search_property fields_to_show="property_type,property_purpose"]
Default field names that you can use are.
- search
- order
- orderby
- agent
- tags
- property_id
- property_area
- property_address
- property_state
- property_zipcode
- property_city
- property_country
- property_rooms
- property_price
- property_type
- property_purpose
- property_status
- property_bedrooms
- property_bathrooms
You can also use custom fields, by specifying their data names.
Search Fields Columns
You can customize the columns in each row by using the columns attribute. The following shortcode will display 3 fields in a row. Search Box, Property Type, and Price Range Slider.
[rem_search_property fields_to_show="search,property_type,property_price" columns="4"]
You can provide the following values for columns attribute.
- 12 – 1 Column
- 6 – 2 Columns
- 4 – 3 Columns
- 3 – 4 Columns
- 5th-1 – 5 Columns
- 2 – 6 Columns
Customize Search Button Label
Customize the label used for the search button using the search_btn_text attribute.
[rem_search_property fields_to_show="search,property_type,property_price" columns="4" search_btn_text="Find Your Home"]
Customize More Filters Button Label
Customize the label used for the More Filters button using the filters_btn_text attribute.
[rem_search_property fields_to_show="property_type,property_price" filters_btn_text="Advanced Options"]
You can also disable the More Filters option by setting the filters_btn_text value to empty. Example: filters_btn_text=”
Create a Reset Fields Button
Create a reset search fields button using the reset_btn_text attribute and setting its value to its button’s label.
[rem_search_property fields_to_show="property_type,property_price" reset_btn_text="Reset"]
Display Properties before Searching
If you want to display some listings with search form before searching and when a user performs a search, replace it with the search results. You can do it by inserting a list shortcode inside the search shortcode. See the following example
[rem_search_property][rem_list_properties][/rem_search_property]
Search in Specific Criteria
Suppose you need a search form that searches only rented properties without giving a visitor the option to change property purpose. For this, you can use the fixed_fields attribute. Provide field name and value separated by pipe | sign. The following search form will display Property Type and Price Range to search, but will only search for those properties which are for rent.
[rem_search_property fields_to_show="property_type,property_price" fixed_fields="property_purpose|Rent"]
You can use multiple values in fixed_fields attribute separated by commas. Same as the meta attribute in List Properties shortcode.
Custom Results Page (Disable AJAX)
If you’re using the search form on the homepage and don’t want to display results under the form, you can open a separate page for results. Use results_page attribute and set its value to the results page URL. Consider we have a page for displaying results and its URL is http://site.com/results
[rem_search_property results_page="http://site.com/results"]
Please note that the results page must have shortcode [rem_search_results]
where you want to display results.
Change Results Place
If you’re using the search form in the widget then you may don’t want to display results under the form via AJAX. You may want to display them inside the content area but still want to display them using AJAX without page reload. You can do that by creating a div and giving it a unique id. Then you can use results_selector attribute to display results in that div. Consider we have a div and id=”custom-results”
[rem_search_property results_selector="#custom-results"]
You should have a little knowledge about HTML Selectors to use this option.
Sort Search Results
You can sort search results by custom order using order and orderby attributes.
[rem_search_property order="DESC" orderby="price"]
You can use the following values for order attribute
- DESC – Descending order of orderby attribute
- ASC – Ascending order of orderby attribute
You can use the following values for orderby attribute
- date – Sort by Property published date
- ID – Sort by Property ID
- author – Sort by Property Agent
- title – Sort by Property Title
- modified – Sort by Property Modify Date
- rand – Random order
- price – Property Base Price
All Available Attributes
Attributes | Description | Default Value |
---|---|---|
fields_to_show | Comma-separated field names to display in the search form | property_address,search,property_type, property_country,property_purpose,property_price |
fields_to_hide | Comma-separated field names to hide under more filters button | |
columns | Columns for each field from 12 columns grid | 6 |
search_btn_text | Text to display on the search button | Search |
filters_btn_text | Text to display on filters button | More Filters |
reset_btn_text | Text to display on the reset button | |
fixed_fields | Provide fixed fields to search in specific criteria, values should be the same as the meta attr | |
results_page | Provide URL of the results page if you don’t want to use AJAX | |
results_selector | Provide selector if you want to display results in a specific area of the same page | |
disable_eq_height | By default, all fields adjust their height automatically, you can disable this behavior by setting this attribute to enable | |
more_filters_column_class | You can maximize the area for search filter values by changing these classes | col-xs-6 col-sm-4 col-md-3 |
agent_id | Provide agent id to display specific results | |
order | Order of results displayed, ASC or DESC | ASC |
orderby | Sort results by date, ID, title or rand for random | |
auto_complete | Autocomplete for text fields | enable |
scroll_results | Use this attribute to handle the page scrolling when results displayed | enable |
masonry | Enable/Disable masonry layout for the results boxes | |
style | Search form style, choose between 1 to 3 | 1 |
tabs_field | Provide field name to display values on top tabs, only for the form style 3 | property_purpose |
tabs_all_text | Label for the first tab | All Purpose |