Developers -- How to assign a specific criteria to a listing page
Posted by Howard R. on 28 April 2014 05:09 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 an advancer 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
Please check this sample shortcode:
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)