Forums › Forums › Search & Filter Pro › Filter within a result set using a second form
- This topic has 4 replies, 2 voices, and was last updated 9 years, 3 months ago by
Anonymous.
-
Anonymous(Private) December 19, 2016 at 2:36 pm #77583
Usually I get things sorted out my self. However this time I am stuck and I don’t find a solution.
On a clients site I need to provide two search and filter options. One is a simple search form in the header of the website. The other one is a more complex form to filter by taxonomies, custom fields and post types.
The site has a couple of custom post types (projects, architects, workers, engineers and so on). All post types share the same archive template. Search and filter is set to display the results as an archive using the same template file.
Everything works fine as expected (and as always with S&F Pro). Now comes the tricky part. Think about the following scenario:
If you visit the site you can enter whatever you want into the search form field located on every site in the header. Lets say you are searching a plumber. After sending the form you get presented with a list of plumbers. Above the results you see some filters like subjects a plumber can specialize in (taxonomy) or a checkbox whether a plumber speaks additional languages (custom field).
This filters should apply to the current result set. However they apply to all custom post types. So if you select the ‘multi language checkbox’ you get all architects, workers and engineers speaking two or more languages. But you should get only the plumbers speaking multiple languages from the first search.
The two search forms are two different forms in S&F. Because the search field gets displayed on each site I cant go he route with a single form using css to hide the fields not needed (duplicate form id). I already tried to change the sfid using ‘sf_edit_query_args’ (replace the id of the complex form with the id of the search field form) hoping this would trigger ‘a reuse of the former query’. But that does not work. Using a transient is not possible due to the way S&F works (two tables to store results).
Long story short. How can use the result set from one S&F query in a second (different) form?
Regards
Michael
-
AuthorPosts