Skip Navigation

[Resolved] Update two views with one filter – update map results when filter submitted for

This thread is resolved. Here is a description of the problem and solution.

Problem:

We have two views:

-View ONE: Includes a Map and Markers

-View TWO: Includes a Filter and a list all items (which correctly updates when the filter is submitted)

We would like the map (view One) to update when the Filter is submitted (in view Two). So the results on the map, match the results below the filter.

Solution:

The simplest solution is merge two post views into one, for example:

https://toolset.com/forums/topic/update-two-views-with-one-filter-update-map-results-when-filter-submitted-for/#post-2192639

Relevant Documentation:

This support ticket is created 3 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by Kate 3 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#2192505
View03_Page displaying both views.png
View02_Filter and List of All Items.png
View01_Includes a Map and Markers.png

* Tell us what you are trying to do?*
We have two views:
- View ONE: Includes a Map and Markers
-View TWO: Includes a Filter and a list all items (which correctly updates when the filter is submited)
We would like the map (view One) to update when the Filter is submitted (in view Two). So the results on the map, match the results below the filter.

* Is there any documentation that you are following? *
No, I have been unable to find any documentation about the old Views plugin.

* Is there a similar example that we can see? *
No

What is the link to your site?
hidden link

#2192639

Hello,

The simplest solution is merge two post views into one, for example, you can move the map + marker shortcode from the map view "Directory Map Output" to the post view "Find a Provider full custom display mode", then display the second post view only.

If you insist on two different post views, you need to edit the second post view "Find a Provider full custom display mode", in section "Query Filter", setup the same filters as the first map view, see your screenshot:
https://toolset.com/wp-content/uploads/2021/10/2192505-View02_Filter_and_List_of_All_Items.png

So both post views accept the same URL parameters to filter the results.

#2193503
Attachment01.PNG

Hi Lou - thank you so much!

I've tried to merge the views (see attachment 01). But now the map is not populating...I feel like I've put the map in the wrong spot...can you help me work this issue out too?

Here is the view output: hidden link

#2193517

You just need to move the marker shortcode [wpv-map-marker ...] into Views loop.
For example, move it to the content template, in the section "Templates for this view" of your screenshot:
https://toolset.com/wp-content/uploads/2021/10/2193503-Attachment01.png

#2196359

My issue is resolved now. Thank you!