IFRAME as Content

Topics: Developer Forum, User Forum
Aug 5, 2008 at 4:47 PM
Hi all,

I am building a website with N2 CMS. It was really easy, until now:

When I am trying to add an IFRAME in the backend by using the WYSIWYG-Editor and pressing the "HTML"-Button the IFRAME and all contents after it is deleted after clicking the "Update"-Button.

It seems that there is some kind of validation, that parses the IFRAME-Tag and deletes it, but I cannot find it in the source.

Do anybody know if there is a problem with IFRAMEs as content? At the moment I simply want to add a "how to find us"-routing-service from another provider with that IFRAME, but maybe I need this feature in other places, too...

Thanks in advance.
Aug 5, 2008 at 6:21 PM
Hi,

in TinyMCE (the editor) iFrame is marked as a non-valid element by default.
You can change this only if you implement a custom editor, see here for an example:
http://www.codeplex.com/n2/Thread/View.aspx?ThreadId=23312 (code in the 4th post).
iFrame should be placed in the extended_valid_elements option.
Aug 5, 2008 at 9:35 PM
Thank you Martijn for the information. Do you know why its marked as non-valid?
Aug 5, 2008 at 10:36 PM
Hi,

I do not actually...that is a question for Cristian to answer....
Coordinator
Aug 5, 2008 at 11:55 PM
I think it's time to add support for iframes. The tinymce integration is rather old and needs a revamp. What do you think is the best way to configure it (attribute string, bit flags, web configuration, etc.)?
Aug 6, 2008 at 5:02 AM
Hi Libardo, why not allow anything in HTML-mode? Otherwise Web.Config will be a good place in my opinion. Is there another way to add the iframe, e.g. without using tinyMCE? I tied to change the StringValue test in the details databasetable itself, but it didnt worked out, to...
Aug 6, 2008 at 10:10 AM
Since there are a lot of configuration-options for tinyMCE and tinyMCE allows the use of complete customized themes, why not support using themes?
More info on themes here: http://wiki.moxiecode.com/index.php/TinyMCE:Creating_Theme
Then a attribute string could be used to set the theme (of different from the default).

But...this means that the theme must be placed in the \Edit\Js\tiny_mce\themes folder, which probably is not what you want...
Still I do think it would be a nice extra for the coders who wish to go a step further.

For a more standard approach imho you'd have to allow setting all the current and future options, which means all the ones set in the .init function if tinyMCE...
Putting it all in the web.config would be a bit overwhelming I'd say and not very easy to read (it is a crowded file as it is).
Why not use a default setting like now (backwards compatible) and allow the configuration of one or more different settings-strings in the database?
I know this would require a configuration-screen in which an administrator must be able to set all options, but after that, in the attribute string these options can be called for each FreeTextArea...


Coordinator
Aug 6, 2008 at 11:26 PM
Thanks for the input. I'll try to make something usable.
Aug 7, 2008 at 4:57 AM
Libardo, could you please inform me when you are finished, so we dont have to code that twice? I could do some beta-tests, too. Thank you in advance.
Aug 8, 2008 at 1:19 PM
Ok, I did it by my own with patching the "init" function in "tiny_mce.js". But it would be nice if there would be a possibility in the future to override the javascript-code to create the Tinymce instance in .NET.

Cheers, Michael.
Aug 8, 2008 at 2:19 PM
euhm, you actually can override that...see the 4th post in this thread.
I've been using that for all my projects at the moment...works like a charm!