Magento – Embed Google Map

google-mapmagento-1.9

Hi I am trying to embed a google map into a CMS page. I get the string from google and paste it using the CMS editor. When i go the the actual page i only see text and no embedded map.

Best Answer

The CMS editor "tidies" entered HTML, even if you turn off the WYSIWYG editor, so it is not suited for code with scripts like from Google Maps.

So what can you do instead? Create a template file with the code from Google and include that in the CMS page:

  1. create the file as app/design/frontend/[your_package]/[your_theme]/template/page/googlemap.phtml, with the code from google as content
  2. include it in the CMS with the following code:

    {{block type="core/template" template="page/googlemap.phtml}}
    
  3. add core/template to the block whitelist in System > Permissions > Blocks to allow this kind of include.

Related Topic