Forums › Forums › Search & Filter Pro › Pass Search Query to another instance of S&F
Tagged: multiple forms, pass query, V3
- This topic has 7 replies, 2 voices, and was last updated 4 years, 10 months ago by
Trevor.
-
Trevor(Private) August 17, 2020 at 4:35 pm #256289
If you are on the results page, the two forms will not ‘talk’ to each other. You would probably be better to use JavaScript. I assume one is the Text Search, and one the rest of the filters? In V3 (due in a few months), we plan to allow you to split a form up which would have the same effect as you want.
For now, you would be better to hide the one form and add a Text box to the other on the results page.
Anonymous(Private) August 17, 2020 at 4:44 pm #256294Hey Trevor,
Yes, that is correct. The main global search form drives to a custom search template, where the filters that are in the sidebar use a Custom results method.
The sidebar filters currently do not have a text search box in them, but are you suggesting that I could use a little bit of JS to grab the current query from the main search bar, and put that value in a hidden text field in the sidebar filters?
If that is correct to assume, that will for sure work for now until v3 is out and we can re-factor.
Appreciate the fast support as always!
Trevor(Private) August 18, 2020 at 10:42 am #256394Ah, let us focus on the sidebar search, as that should be you main search (but, I would normally have the header search, if one of our forms, set to Custom, using the same URL as the sidebar search, with Ajax OFF, and NOT use the guidance I sent you in the previous message, as this header search is NOT the theme search).
That sidebar search should have a text search box in it, so that, when the search from the header search arrives on that page (now set in that header search form as it is now set to Custom, with that results URL).
On the results page, I would hide the header search. If you inspect the results page, in the body tag, will be a class name for the page (e.g. page-id-1234) which you can use to conditionally hide it).
-
AuthorPosts