MangoBlog, How to Enable iFrame Tag in TinyMCE
Posted by cheyennejack at 3:02 AM
1 comments - Categories: Programming | ColdFusion | Security

First off let me start off by saying that I absolutely love using MangoBlog. As a complete coder and non-designer, I have been able to whip together a bit of a design and even transfer blogs from various sources into here. Kudos to the MangoBlog team, no wonder there have been so many converts.
However, tonight I did run into a bit of a snafu that took me awhile to resolve. One of the great parts of Mangoblog is that you just run it and really dont have to inspect it much further.
Now while I normally would say spend some time and get to know the architecture behind MangoBlog, I know some out there just want the answer to the question, so here goes.
MangoBlog uses TinyMCE. By default TinyMCE strips the iFrame tag and some other tags from your HTML Editor view. So try as you may, any iframe tag will be erased and deleted before getting saved. Manually editing the database as a workaround sounds great, but really it isn't, trust me I know.
To force TinyMCE to allow the iFrame tag in MangoBlog follow these steps.
- Open [mangoroot]/admin/layout.cfm
- Around line 42 you will see a line for "extended_valid_elements"
- Replace with
extended_valid_elements : "span[class|style],code[class],iframe[src|width|height|name|align|frameborder|scrolling]", - Don't forget the trailing comma
- Save and reload your posting area, then play with iframes to your hearts desire.
Obviously, you can use this same technique by adding tags and attributes here that TinyMCE strips by default. I would only recommend doing this on an as needed basis though. The blog posting I needed this for was for an old webisode covering a fictional hacking of Las Vegas casinos with SQL injection and other techniques. I strongly recommend less tech-savvy developers and even clients taking a look at this informational video to start to understand the dangers their systems face everyday.
Mike wrote on 11/07/08 10:52 AM
mine was [mangoroot]/admin/editorSettings.cfmline 28