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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Embed an iframe into a page


Go to End
Reply


9 Posts   6855 Views

Avatar
stuartm

Community Member, 4 Posts

27 June 2008 at 9:41pm

Hope someone can help, I'm trying to embed an iframe into a webpage but the <iframe> code is being stripped out. I searched the forums and could only find reference to an iframe module, but that doesn't seem to allow you to have normal content as well as an iframe on a page. Can someone please explain how to allow iframes?

Thanks - Stuart.

Avatar
Phalkunz

69 Posts

28 June 2008 at 1:26am

By default, iFrame is not enabled by TinyMCE (the visual editor). To enable it, add iframe[src|width|height] to extended_valid_elements in /cms/javascript/tinymce.template.js. After adding it would look like this extended_valid_elements : "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],iframe[src|width|height]"

NOTE: make sure there is NO space between the comma and iframe.

Avatar
stuartm

Community Member, 4 Posts

28 June 2008 at 9:38am

Thanks for that, it worked perfectly. Although I'm not a fan of editing core files as I need to be careful when performing upgrades. I come from a Wordpress background and you can create a plugin to extend the tags allowed in the TinyMCE - is there anything similar in Silverstripe?

Avatar
Phalkunz

69 Posts

29 June 2008 at 12:17pm

@stuartm: I come from Wordpress background as well and i'm very new to SilverStripe. you asked is there anything similar in Silverstripe? I'm not sure what you mean by that. If you have any specific question post it up in the form.
Cheers.

Avatar
stuartm

Community Member, 4 Posts

29 June 2008 at 12:39pm

My question was "can you create a plugin to extend the tags allowed in TinyMCE?"

Avatar
Phalkunz

69 Posts

29 June 2008 at 12:47pm

Edited: 29/06/2008 12:48pm

That I'm not sure about but as far as I am concerned modifying conf in TinyMCE is easier than creating a plugin. You might wanna post a new question asking whether you can create a plugin/module that changes the behaviour of TinyMCE.

Avatar
stuartm

Community Member, 4 Posts

29 June 2008 at 1:04pm

The problem with modifying the TinyMCE directly is that every time you do an upgrade, you'll overwrite your changes, unless you are sure you can keep track of all the changes you have made.

Avatar
Phalkunz

69 Posts

29 June 2008 at 9:33pm

Yep, you're right.

Go to Top