Forums › Forums › Search & Filter Pro › Two Different Instances of SFP on 1 page
Tagged: archive results, custom results, multiple forms, V3
- This topic has 4 replies, 2 voices, and was last updated 4 years, 3 months ago by Anonymous.
-
Anonymous(Private) August 11, 2020 at 9:32 pm #255727
Hello,
So I am running into an issue that I have dumped a decent amount of time in to at this point so not sure if I am just overlooking something or maybe my desired result just isn’t possible, so I figured I would ask at this point.
I have a global search by on all pages of my site configured to search a CPT. The Display Results tab is setup for “Custom” and I have my URL in the result text field. That URL is also an existing page that has a list of all categories in that CPT in 1 column and in the other has another instance of SFP with a bunch of filters.
The sidebar filters variation works as expected. The search bar that appears on all pages does return results that do make sense however it only returns 10 (in my WP Readin settings) ignores the 12 I have set in the General tab of the config for this form and shows only 1 page.
If I change this form to be an Archive, and point it to a custom search.php file it works with returning the correct numbers of results and pagination.
So, my question is, can I have it set up where 2 forms use the same Custom setup and URL to display results? Or is that creating a conflict and 1 of them has to be set up either as a different custom URL or changed to an archive?
Thanks for any insight!
Trevor(Private) August 12, 2020 at 10:50 am #255760Doing this (having more than one instance of the same form, or even multiple different forms) will mean that they don’t work together and often will conflict with each other. Just be aware that this is possible, so if you have problems with the results not working, that might be why. Normally, we suggest only one form instance on the results page.
You CAN have the two forms on any page other than the results page.
Are both forms set to Custom, how are they being linked to the results? If they are being linked to the arguments in the template, they would also conflict.
In V3, due in a few months, will alow you to split a form up into parts and place these parts in different places on the page.
Anonymous(Private) August 12, 2020 at 5:21 pm #255867Trvor,
Thank you for the fast response. “You CAN have the two forms on any page other than the results page.” sounds like it hit the nail on the head for me.
They were linked using arguments in the code which I could see why now was creating some issues.
When using the global text search that I have, it drives to the same results page as my sidebar filters search instance. An ideal world I was almost hoping that if you executed a search for the word “vehicle” that on the results page you could use the sidebar filters to further drill down the results, but that same sidebar filter search instance could also work stand alone if you were on the results page (before results were shown)
I picked up on some inherited conflicts already that the sidebar form was overwriting some settings from my global text search at the top. Since posting this I have moved the global text search back to being an Archive using a custom search.php file that looks just like the original Custom Results page. This still has the sidebar filters form on it so I have to tinker with that some.
Excited for v3, the rumblings in various responses I have seen on the forums look very promising!
-
AuthorPosts