[Gelöst] How to make default results blank for parametric search – continued?
Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.
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.
This support ticket is created vor 7 Jahren. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
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.