I have been doing some basic background research into how we might embed Google Maps (or other things) into discourse. The purpose of this would be to ultimately embed an Ideal Network Map (INP) safely.
ChatGPT suggests the following:
Discourse has a handful of plugins and built-in “onebox” handlers that leverage oEmbed to safely embed content from supported providers (e.g. YouTube, Twitter—and with the right plugin, Google Maps). The most popular community option is the discourse-oembed plugin (sometimes called “onebox-oembed”) which:
- Adds oEmbed support for extra sites
– Beyond the built-in list, you can whitelist additional oEmbed providers (e.g. Google Maps, Mapbox, SoundCloud, Vimeo, etc.).- Handles link-only embeds
– You simply paste a share URL on its own line; the plugin fetches the oEmbed JSON endpoint, sanitizes the returned HTML (stripping scripts/CSS), and renders a safe<iframe>or<blockquote>.- Respects Discourse’s security
– All embed HTML is passed through the same sanitizer, so you never open up your site to arbitrary iframes—only those the admin has explicitly enabled.- Is easy to configure
- Install via your host (if using a hosted service) or clone the repo into
plugins/on self-hosted forums.- In Admin → Settings → oEmbed, add the provider’s oEmbed endpoint (e.g.
https://www.google.com/maps/oembed?url=%{url}).- Optionally set max width/height, timeout, and caching rules.
- Supports caching
– oEmbed responses are cached in your Discourse database to avoid repeated external calls.
There were also some other links given:
Any thoughts on this or an alternative for embedding maps into the forum? Is Google Maps preferred or is there perhaps something that might better meet our needs?