To answer your question faster, you can search our knowledgebase articles before submitting a ticket.
Knowledgebase

Developers -- How to assign a specific criteria to a listing page

Posted by Howard R. on 20 May 2022 05:16 AM

Using WPL default query types

WPL search feature work by using standard criteria query strings, so you can simply define your desired criteria for a specific listing page. Some important parameters are accessible through WPL shortcode wizard. For example, you can specify "listing type", "property type", "user", property tags such as "Featured", "Hot", etc so you can use them easily.

If the shortcode wizard parameters are not enough for you and you want to specify more advanced criteria, you can insert the parameters manually on shortcode. Search query parameters are using this structure: sf_[query-type]_[column-name]=[value]

For example, by adding sf_select_listing="9", WPL will show "For Sale" listings. Some query types need 2 parameters like min/max query type. If you send sf_tmin_f_150="1" sf_tmax_f_150="5" it will show the listing that has at least 1 parking space and maximum 5 parking spaces.

Please check this sample shortcode: [WPL sf_select_listing="9" sf_tmin_f_150="1" sf_tmax_f_150="5"]

You can find all the default query types by tracing this path: [wpl-path]/libraries/create_query/

Creating your own query type

You can also simply create your own query type if needed by adding a new file into the [wpl-path]/libraries/create_query/ directory. you can check one of the default ones as a sample.

Overriding query types

Also WPL has a structure to override query type files. For example, if you want to modify textsearch query type, you can copy and paste the original file and save the new file with an underscore in the beginning of its name (ie: you could create this file for overriding textsearch.php default file: [wpl-path]/libraries/create_query/_textsearch.php)

Here is how you can add a shortcode on WPL:


Comments (0)