You are on page 1of 2

Cch nhng Tinymce lm b son tho cho website

Tinymce l 1 trong nhng editor c s dng rt nhiu, im li khi dng mce l n gin ci t, d dng thay i, ty chnh, hn ch li pht sinh sqlinjection. Trong bi vit ny th thut vit nam s dng Version 3.3.9.2 hng dn nhng Tinymce bn cn tin hnh 4 bc: Bc 1 : Download b Tinym, bn nn download b Main packages (stable) Bc 2 : Chn file tinymce.js vo gia cp th <head></head>

Bc 3 : Ty chnh button mun hin th (c th mc nh khng cn sa) Mc nh tinymce nhn tt c cc th <textarea> v thay th thnh editor mce, tuy nhin i lc trong thit k n li khng cn thit v th ti khuyn bn ci t tinymce ch nhn cc th textarea ch nh Bn c th xem hng dn vi 1 file button ty chnh bn di
tinyMCE.init({ // General options mode : "exact", // mc nh mode : "textareas", nu s dng mc nh b dng elements bn di elements : "textarea_full", // ci ny l ty chnh ca bn , nhn tt c cc textarea c id l textarea_full theme : "advanced", plugins : "spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotion s,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,conte xtmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xh tmlxtras,template", // Cc button s thm vo, theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright ,justifyfull,|,formatselect,fontselect,fontsizeselect,media,image", theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,cleanu p,code,|,forecolor,backcolor,|,sub,sup,|,charmap,emotions,iespell,|,cite,abbr ,acronym,del,ins", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,blockquote,pagebreak,fullscreen",

theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Skin options skin : "o2k7", skin_variant : "silver", // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } });

Bc 4: Ty chnh th textarea T gi th textarea no bn mun chn tinymce vo th s dng nh bn di: <textarea name=content id=textarea_full style=width:100%; > </textarea> Vi cc th textarea khng c id=textarea_full s khng c nhng tinymce Bn c th xem thm v d y cc button ti y

You might also like