Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

adding iFrames to a page

Go to End

5 Posts   1532 Views


Community Member, 63 Posts

30 May 2011 at 6:50am

Edited: 30/05/2011 6:51am

I know this has been discussed previously but somehow no one came to a solution (at least not a simple one) so my question is (once again) IS there a (simple) way to add an iFrame (such as googlemaps) to any page using the standard editor? I´m even willing to hardcode it to the specific page but (don´t laugh at me) I have no clue where to find the html code for e.g. my contact page?? There probably is none, right? :-p
It can´t be that hard, can it???

btw: using SS 2.4.5


Community Member, 90 Posts

30 May 2011 at 10:49am

you could turn off the tinycme default validator by inserting the following code into mysite/_config.php

HtmlEditorConfig::get('cms')->setOption('verify_html', 'false');// turn off html validation


HtmlEditorConfig::get('cms')->setOption('extended_valid_elements', "+iframe[src|width|height]");


Community Member, 63 Posts

31 May 2011 at 12:29am

thanks for the reply. I added the latter code to my _config.php and ran a dev/build. Sorry for asking this but how am I to copy the iFrame into my page after that? Is there supposed to be a special field/tab? Simply pasting the code into the html editor doens´t work ...


Community Member, 90 Posts

31 May 2011 at 9:38am

well, you could be able to create a HTMLText in your page.php

static $db=array(

Then add fileds to your page.php

public function getCMSFields(){

$fields->addFieldToTab("Root.Content.GoogleMapArea", new TextArea('GoogleMapArea','Google Map Area'));

return $fields;


then you should be able to paste your code (iframe)into that area block.


Community Member, 63 Posts

1 June 2011 at 1:32am

Wow that worked great!! couldn´t find the button at first cause it has no decoration icon :-)

many thanks!!!