Home › Forums › Calendar Products › Events Calendar PRO › Google Maps in Footer on Events Page – Duplicate GMaps Script + ACF Problem
- This topic has 3 replies, 4 voices, and was last updated 9 years, 6 months ago by
Nico Rettinger.
-
AuthorPosts
-
October 7, 2016 at 7:23 am #1173709
Nico Rettinger
ParticipantHello,
i`m using the Events Calendar Pro and Advanced Custom Fields Pro on my Website.
I have a Google Map in my footer with multiple markers which can be set up by the user in the backend on an ACF Options Page.
Everything works fine with the Events on other Pages, but on the Events-Pages itself, there are two problems:1) The Events Calendar Pro load it’s own GMaps Script, but because i already load it on every page for my Footer-Map, I get an JS Error:
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
Can I dequeue the whole GMaps-Scripts from the Events Page or is there any other solution?2) To load the markers into the map, i use the ACF-Function ‘if( have_rows(‘locations, ‘option’) ):’. But on the Events page, this ACF-Function gets ignored and skipped. Is there a way to fix this? I think it’s a problem with The Events Calendar, because on every other page, the footer works fine.
Thanks for your help!
Greets
Nico
October 8, 2016 at 5:55 am #1174053Cliff
MemberHi Nicolas.
In our forums we keep our threads focused on just one issue at a time to ensure we fully answer each of your questions/issues. Please keep this in mind for the future and start a new thread for your additional question from this thread. Thanks for your understanding, and I’ll answer only your first question…
We recommend dequeuing your other plugin’s Google Maps script on The Events Calendar pages. Here’s a code snippet I wrote for someone else’s theme that was including its own Google Maps and generating the same error message (we see it fairly often):
https://gist.github.com/cliffordp/ca3baf77c9be8b72f37db10c7c91783b
You could adapt that to your other plugin’s script handle.
Another way to go about this is to just completely dequeue our Google Maps and let your other plugin’s script loading handle it all. Our script handles include:
- tribe_events_google_maps_api
- tribe_events_embedded_map
- tribe-gmaps (tribe-events-pro-geoloc loads this as a dependency)
- tribe-events-pro-geoloc (may only be used when PRO gets the coordinates based on a Venue’s address so might not want to dequeue)
I’m not 100% certain that’s all of them, but I’d also not recommend dequeuing them anyway 😉
Please let me know how it goes for you.
October 30, 2016 at 9:35 am #1185041Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Google Maps in Footer on Events Page – Duplicate GMaps Script + ACF Problem’ is closed to new replies.
