Forums Forums Search & Filter Pro Filter within a result set using a second form

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #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

    Trevor
    #77606

    Is the field selected from the first form available in the second?

    Anonymous
    #77618

    No. There is no search field in the second form

    Trevor
    #77620

    It would need such a field to work the way you want, hidden or otherwise.

    Anonymous
    #77623

    You rock! It works. Sometimes the easiest way is not what one thinks of. Thank you!

Viewing 5 posts - 1 through 5 (of 5 total)