Carto Map embed issue
Lizzie Macaulay-Lewis is having a problem embedding a Carto map into a post. Please see the screenshots below. She goes into text mode, pastes in the embed code, goes back to Visual mode and sees the map, then she clciks update, and it is gone.
She has the Carto plugin installed. She tried contacting Carto - but they do not support the plugin.
From Carto's documentation, it is not clear if the plugin is necessary - https://carto.com/docs/faqs/sharing-maps/
I tried without the plugin and it didn't work.
#1 Updated by Boone Gorges over 3 years ago
- Status changed from New to Reporter Feedback
We don't allow site administrators to use iframes on the Commons, for security reasons. This is why the iframe code is being stripped when the post is saved.
We do have oEmbed support for CartoDB. Entering a CartoDB URL on its own line in the editor will cause the map to be embedded automatically. See #5776. Could you please test and make sure this works as expected?
#2 Updated by scott voth over 3 years ago
Ah, I see. I didn't notice that Lizzie was using an iframe in this scenario. But that is as close as we've gotten for the map to embed. We've tried using oembed:
Neither worked. She had the Carto plugin enabled, I didn't.
I tried on a non Commons site - still didn't work.
I think Lizzie tried on a non Commons site that worked - but I am not sure if she used iframe.
I also activated JetPack to see if that would work, but no luck.
Lizzie - do you have anything to add?
Is the plugin required and not working, or is the simple oembed not working for some reason?
#3 Updated by Boone Gorges over 3 years ago
Here's a site where oEmbed is working as expected: https://bbgtest1.commons.gc.cuny.edu/2018/06/21/cartodb-test/
See screenshot for what it should look like in the back end. Maybe you're using the wrong syntax?
(This would not work on a non-Commons site, unless you're using Jetpack - I cribbed the oembed code from Jetpack.)
#5 Updated by Boone Gorges over 3 years ago
If she's running a Commons site, she does not need Jetpack. The oEmbed rule works on every site on the Commons, without the need for Jetpack.
You mentioned that you tried this on a non-Commons site. On a non-Commons site, you do need Jetpack for CartoDB embeds to work.
If you're not seeing what you expect on the Commons, try creating a new post. WordPress caches the results of oEmbed requests on a per-post basis, and it may have cached a bad request for you. Alternatively, if you give me the URL of the post(s) where you've entered the CartoDB URL and are not seeing the embed, I can clear the cache, or do other debugging that may be necessary.