[Resolved] How to make default results blank for parametric search – continued?
This thread is resolved. Here is a description of the problem and solution.
Problem:
Show results only when a search parameter is selected. On page load no results should be shown, only Custom Search Form should be visible when we open page.
Thank you for contacting Toolset support. You can achieve this by using 2 pages, first page will have the Search form only and second page will have results and search filters (pre-selected from the previous page).
When you insert a Custom Search View into a page, it will give you option to separate form filters and results, and it will provide you with shortcode and instructions on how to add them separately, please follow the instructions given on screen.
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
++++ here i would like to set a condition to show the content only if the URL parameter is not empty
[wpv-post-title]<br>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
Is there a way to make a condition that the URL parameter "wpv-specialist-country" is empty?
==> Yes, we can achieve this using small shortcode. Please add following code in your theme’s functions.php file:
Please note: It may not work if you are using Ajax in your View. Toolset does not offer a builtin option to handle this feature on the same page, probably because of the complexity of handling all View’s options.