Thursday, 12 February 2015

carto - How do you embed iFrame content into a CartoDB infoWindow?


All,



I'm trying to embed Youtube videos and SoundCloud audio clips into a CartoDB infoWindow. I'm trying to do this by simply using the {{embed}} column and entering it into the custom infoWindow html...



x


name


{{name}}


description


{{description}}


{{embed}}






To see the result, click one of the two point features in the map:


Result Map:


http://cdb.io/K8yZ9V


SoundCloud embed code:





Youtube embed code:




Answer



The answer that @Javier provided in January was totally correct at that time, but now due to security restrictions inserting iframes inside the CartoDB Editor (infowindows or legends) is no longer supported.


In order to achieve it, you'd need to use CartoDB.js to create your customs infowindows. Besides this, make sure you disable "sanitizeTemplate" so that your scripts are not removed.


sanitizeTemplate: By default all templates are sanitized from unsafe tags/attrs 
(e.g.

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...