Skip Navigation

[Resolved] I need to know how I can split up the map from its filters on the front end

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

Problem: I would like to display a map with markers, but I want to use custom search filters displayed in a different area of the site.

Solution: Insert the map shortcode using the Fields and Views button. Make the map ID something unique. Create a View to display the filters, and include the map marker shortcodes in the loop. Reference the unique map ID in the map marker options popup. Place the View where you want to display the filters.

Relevant Documentation:
https://toolset.com/documentation/user-guides/display-on-google-maps/

This support ticket is created 5 years, 9 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 66 replies, has 2 voices.

Last updated by jessicaM-4 5 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#1235759

O just to make sure we are on the same page I will not be able to add a drop down filter to a different page that would take the user to the results on the current maps page we have now.

#1235773

What part of the documentation leads you to say that?

#1235776

Sorry I miss-understood "You have the option to insert only the search form when you insert the View shortcode.". I just saw the word only.

#1235782

Okay

#1235793

Afternoon Christian,

How would I create a button to switch between regular and seasonal locations on the map? I have seasonal set up as a category for location already. I guess I can add it to the same view as the map dropdown and search?

#1235819

I'm not 100% sure I understand how this would work. It seems like you have included Seasonal as one term in the Location Services taxonomy. You already have one filter set up for the Location Services taxonomy. It's not possible to create two filters for the same taxonomy, and it's also not really possible to create a filter for toggling one single term in a taxonomy. So I think this is not the best approach. Normally to filter between "A" and "B" options, you use a custom field radio button to store option A or B for each post, then add that as a custom field filter in your View. Is that possible for your situation?

#1235822

Yes thats possible. I could then just style the radio inputs to look like buttons. Could I use the same map to display the results?

#1235828

Yes, you can combine those radio inputs I mentioned with the current distance filter and location services filter, and display the results on the same map. Or, you can create a new View with only the radio inputs and display the results using the same map shortcode, placed somewhere else on the site.

#1235830

nice! Would i need to figure out a different way to filter it or can I use my existing taxonomy category of seasonal?

#1235849

Would you be able to take a look at the radio I added the view. Its showing all of the location services again.

#1235857

I see the locations services taxonomy dropdown filter but no radio filter. If you want to add a radio button filter for a custom radio field, edit the View. Scroll up to the Query Filter panel and delete the existing Query Filter for the custom field. Then scroll back down to the Search and Pagination editor panel and click New Filter. Add the custom field filter here and choose the radio button option to display the filter. The Query Filter will be updated automatically to match the filter control you create in the Search and Pagination panel.

#1235868

I did previously add a radio button but it was showing all of the services in a list. I just need it to show the seasonal option and show the relating map markers. I think where I get confused is the proper groups and fields to choose. So once im in the insert a custom filter window what group should I pick? Field group for locations Location services? Then after I have chosen a field or group how do I edit the filter by post field location window to just have a yes or no for seasonal. Can you explain it to me step by step?

#1235869

So I guess the map would show all locations and when you click the radio button it will show the seasonal location that will have a different Marker

#1235871

I have the radio set up in there now but its not effecting the map.

#1235879
Screen Shot 2019-04-25 at 5.01.07 PM.png

You haven't created a radio custom field anywhere to store a value for seasonal or non-seasonal. You've created a radio filter control linked to an existing WYSIWYG field that has nothing to do with seasonal or non-seasonal, it just happens to be called Location Services. Here are the steps you need to take to get this working.
- Create a new custom radio field in the "Field Group for Locations" field group. The radio button should have two options - one for seasonal and another for non-seasonal.
- Edit every Locations post and assign a seasonal or non-seasonal value in the custom field you just created.
- Edit the map-search View and remove the Query Filter for the location-services custom field
- Scroll down to the Search and Pagination panel and remove the filter control shortcode associated with location-service:

[wpv-control-postmeta field="wpcf-location-services" type="radios" source="custom" url_param="wpv-wpcf-location-services" values="," display_values="Regular,Seasonal"]

- Now click "New Filter" above the Search and Pagination panel and create a new filter for the radio field you created and populated in every location post.