Skip Navigation

[Resolved] Display the same search results from a View with 2 different search forms

This support ticket is created 5 years ago. 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.

This topic contains 1 reply, has 2 voices.

Last updated by Beda 5 years ago.

Author
Posts
#1487861

I have a View on my homepage which has a search form containing a text to search with a submit button that leads to a separate page to display the search results. I want to have a different search form on this same search results page that has a text to search, and also 2 dropdowns for custom field filtering.

Is this possible? I wasn't able to find any documentation regarding this issue.

#1488269

If the search form you want on the results page is the exact same as the one submitting the search in the beginning, you can just use that same shortcode (the search part of the View) to show the search as well on the results page.

If you want new search arguments in that very search on the results page, then you could hide the additional Search filers in the original view in an HTML condition checking on the URL parameters which you will use on the First View (where you submit the search).

Listening to those will allow you to show the other search inputs only if the first search was submitted (has URL parameters set).
You would then hence still use the same view, insert the search part of the View in the results page, which would then show the additional search parameters only if the original search was submitted.

Something like this would be a example of such HTML Condition:

[wpv-conditional if="( '[wpv-search-term param="mine"]'eq 'this' )"]
Show here your additional Search inputs in the view search section
[/wpv-conditional]

This is built with the "Conditional" GUI of Toolset, you can also use this DOC as reference:
https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/