Skip to content
World Wide Web Server edited this page Jul 4, 2012 · 12 revisions

Category:Library::External | Category:Library::WYSIWYG [h2]Introduction[/h2] TinyMCE is SUPER easy to put in a CI view. You just have to add the TinyMCE to your site, say in ‘scripts/tinymce’ folder. Then add a link to the file in the header of your web page, and set up the TinyMCE init (if you have special wants needs.) You may want to edit TinyMCE's config file as well to your liking.

[h2]Download[/h2] [url=http://sourceforge.net/projects/tinymce/]Download TinyMCE[/url] [url=http://tinymce.moxiecode.com/]TinyMCE homepage[/url] [url=http://wiki.moxiecode.com/]TinyMCE Wiki[/url]

[h2]Instructions[/h3] Below I’ve put my configuration for TinyMCE. (take the + sign out of the script tags to get it to work… all this stuff goes in the HTML head.

[code]<scri+pt src="<?=base_url()?>scripts/tiny_mce/tiny_mce.js" type="text/javascript">

    tinyMCE.init({
        theme : "advanced",
        mode : "textareas",
        plugins : "imagemanager,filemanager,insertdatetime,preview,emotions,visualchars,nonbreaking",
        theme_advanced_buttons1_add: 'insertimage,insertfile',
        theme_advanced_buttons2_add: 'separator,forecolor,backcolor',
        theme_advanced_buttons3_add: 'emotions,insertdate,inserttime,preview,visualchars,nonbreaking',
        theme_advanced_disable: "styleselect,formatselect,removeformat",
        plugin_insertdate_dateFormat : "%Y-%m-%d",
        plugin_insertdate_timeFormat : "%H:%M:%S",
        theme_advanced_toolbar_align : "left",
        theme_advanced_resize_horizontal : false,
        theme_advanced_resizing : true,
        apply_source_formatting : true,
        spellchecker_languages : "+English=en",
        extended_valid_elements :"img[src|border=0|alt|title|width|height|align|name],"
        +"a[href|target|name|title],"
        +"p,"
        invalid_elements: "table,span,tr,td,tbody,font"

    });

[/code]

Your init may vary based on the features you want. I didn’t want my clients to screw anything up by pasting in word html, so I made things like table tags & span tags invalid and removed formatting from p tags, etc. I also use imagemanager & filemanager (which I included in the plugins list at the top.

Clone this wiki locally