Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

ACF Google Map

  • Hello. Working with a custom Events & Venues system with ACF, using one ACF CPT for the venues and another for the event. Two field Groups, one for venues and one for events, with the venue field group inside the event field group as a Post Object type.

    In an Element I can dynamically pull all the ACF fields and for the venue details that works fine with dot notation, eg:

    {{post_meta key:event_venue.venue_location}}

    But, it doesn’t work for Google maps – this obviously is an array. Is there no way to pull in a Google Map field from ACF using Dynamic Tags, then? Nothing is output at all on the page, all the other tags yes, Google maps, nothing. I can obviously just use Embed code and that works but I’d love to be able to offer the client the full Google Maps option when creating a new venue in the CPT.

    I’ve seen a few older posts where you answered that there’s no way to dynamically pull a Google Map but am wondering if that has changed in GB 2.0? Thanks.

  • Hi there,

    What if you try to use the text field or text area field to store the Google map embed code, then try to pull it via text block?

    https://wordpress.com/support/google-maps/

    Let me know if this helps!

  • Well yes, that works, but in this case it’s not about embed code, it’s about native ACF Google Maps field. If used in a CPT then the client has a simple interface onto Google maps, with search for address, and that works for them, I am not going to ask them to copy and paste code otherwise I wouldn’t bother with ACF at all, I’d just put cutsom HTML directly into the Element for the CPT.

  • Can you provide an admin login to your site so I can do some tests to see if GB can pull the Google map field?

    Let me know 🙂

  • Thanks for the login. However, I don’t see the ACF plugin being installed on the site.

    Am I missing anything?

  • Login was for production, not staging, sorry. Have edited URL to add /staging.

  • Thanks for the login, I tested it, and it didn’t work.

    I think using the embedded Google map code via the text area field would be the best bet.

    However, you can also check with ACF support to see if there’s a shortcode you can use to output the map.

  • Hello, and thanks. There is no Shortcode option, unfortunately. A shame this doesn’t work as having the simplicity of just giving client a standard Google Maps interface via ACF with the selection output through GB dynamic tag would have been very nice indeed. So yes, Text Area with embed code from either Google or OpenStreetMap is only way to go for now, but that’s not an easy fix for clients!

  • I can see that, unfortunately!

    I’m surprised that ACF does not offer a way to output its own field.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.