- This topic has 1 reply, 2 voices, and was last updated 10 years, 6 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Filter two loops at once
The scenario: I have a listing of available apartments. I want to display all apartments on a google map (so I would need a loop without pagination).
I also want to display all apartments in a list next to the map but this I want to display with pagination.
I also want both of the loops to update when I use the filters.
Is this possible with search and filter pro? I.e. to have two loops on the same page controlled by the same filter?
This is not possible within the plugin itself…
But there is a potential hack I can think of.
What you would need to do is create two search forms – with two separate results loops (shortcode method I think is best for this purpose).
Lets call them Search Form A and Search Form B, and then we would have Results Loop A and Results Loop B.
So you would hide Search Form B with CSS – so its not visible (but it is necessary to be present because this search form has control of Results Loop B)
Then would have to write some JS for the rest.
You would need to detect when an input/select element in Search Form A has changed OR you can detect the submit, and when this happens you would need to set the fields in Search Form B to the same value, and then trigger a submit.
I’m not sure of you level of JS coding, but providing the Search Forms have the same fields I don’t think it would be too tricky.
Hope that helps!
Thanks