How to get around tag restrictions in MangoBlog editor

ColdFusion , Railo Add comments

MangoBlog uses TinyMCE editor when adding/editing articles and pages, which by default will strip out certain tags, including iframe tags, which I needed for posting youtube videos.

The solution is actually very simple.

open up the admin/editorSettings.cfm

and add the following line with any tags[parameters] you want to allow.

extended_valid_elements : "span[class|style],code[class],iframe[src|width|height|name|align|frameborder|scrolling]",

 

In addition if you have “script protection” enabled, then this will replace certain tags (such as iframe) with the text “InvalidTag”. Either your ColdFusion/Railo Admin has Enable Global Script Protection turned on or your Application has scriptProtect set to true. This would be set in either the CFAPPLICATION tag or the This scope of your Application.cfc file.

below is the full code with my amendment.



<!-- TinyMCE --> 
<script type="text/javascript" src="assets/editors/tinymce_3/jscripts/tiny_mce/tiny_mce.js"></script> 
<script type="text/javascript"> 
    <mangoAdmin:Event name="beforeTinyMCEinit" /> 
    tinyMCE.init({ 
        mode : "specific_textareas", 
        editor_selector : "htmlEditor", 
        theme : "advanced", 
        plugins : "table,save,contextmenu,paste,noneditable,asffileexplorer", 
        entity_encoding : "raw", 
        theme_advanced_toolbar_location : "top", 
        theme_advanced_toolbar_align : "left", 
        theme_advanced_path_location : "bottom", 
        theme_advanced_buttons1 : "bold,italic,formatselect,styleselect,bullist,numlist,del,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,removeformat,charmap,code,help", 
        theme_advanced_buttons2 : "", 
        theme_advanced_buttons3 : "", 
        paste_remove_spans: true, 
        extended_valid_elements : "span[class|style],code[class],iframe[src|width|height|name|align|frameborder|scrolling]", 
        theme_advanced_resize_horizontal : false, 
        theme_advanced_resizing : true, 
        relative_urls : false, 
        remove_linebreaks : false, 
        strict_loading_mode: tinymce.isWebKit, 
        document_base_url : "<cfoutput>#blog.getbasePath()#</cfoutput>", 
        <cfif len(currentSkin.adminEditorCss)><cfoutput> 
        content_css : "#blog.getbasePath()#skins/#blog.getSkin()#/#currentSkin.adminEditorCss#", 
        </cfoutput></cfif> 
        <mangoAdmin:Event name="tinyMCEinit" /> 
        <cfoutput> 
        plugin_asffileexplorer_browseurl : '#blog.getSetting('urls').admin#assets/editors/tinymce_3/jscripts/tiny_mce/plugins/asffileexplorer/fileexplorer.cfm', 
        plugin_asffileexplorer_assetsUrl:'#fileUrl#', 
        file_browser_callback : 'ASFFileExplorerPlugin_browse' 
        </cfoutput>, 
        onchange_callback: function(editor) { 
            tinyMCE.triggerSave(); 
            $("#" + editor.id).valid(); 
        } 
    }); 
    <mangoAdmin:Event name="afterTinyMCEinit" /> 
</script> 
<!-- /TinyMCE –>


0 responses to “How to get around tag restrictions in MangoBlog editor”

Leave a Reply

Leave this field empty

Powered by Mango Blog. Design and Icons by N.Design Studio