0

I added some custom php to my site in order to be able to embed a leaflet map using an [iframe src=""] tag. This works.

More recently I've wanted to embed a CartoDB map. e.g.

[iframe src="https://bcu.cartodb.com/viz/4aa385ec-f83d-11e5-9dc1-0e3ff518bd15/embed_map" width="827" height="582"]

I initially tried the above method but get a iframe box with no content, as per the image below.

enter image description here

After some searching I found that just pasting the public_map URL should just work as per here and here. No luck. Nothing happens in the visual editor, and the URL isn't being treated as a hyperlink either.

  • 1
    Are you on a wordpress.com site or a self-hosted wordpress.org install? The pages you linked to re CartoDB embeds are for wordpress.com sites only, and this site you are on now is for wordpress.org (i.e. self-hosted) sites only. :) Having said that, since you've added custom PHP you're probably on a self-hosted site. Can you elaborate what this custom PHP is? Also, are there errors in the console? – Tim Malone May 24 '16 at 1:12
  • @TimMalone, ahhh. I missed the distinction between self-hosted and hosted in these features. We are not hosted on Wordpress. No errors in the console besides FF complaining that the other leaflet map I'm loading is "insecure". I'm going to look into where I found the custom Wordpress code. Also testing whether the embed works on a jekyll site. – raphael May 24 '16 at 1:52
  • facepalm Privacy Badger was at it again... – raphael May 24 '16 at 2:01
  • It may be helpful if you'd post the solution as an answer so others can learn from it. – Morgan Estes May 24 '16 at 4:47
0

1 The [iframe] custom shortcut

Turns out the content from CartoDB was being blocked by Privacy Badger a browser plugin that disables trackers and other malicious content. The solution was to allow content from username.cartodb.com as in the image below

Privacy badger screenshot

The Magic "Paste and it Just Works(tm)" Method

This apparently only works in the Visual Editor and only works for blogs hosted on Wordpress.com, which was not the case for my site. Thanks to Tom Malone for pointing this out in the comments above.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.