{"id":402,"date":"2011-03-17T23:12:47","date_gmt":"2011-03-18T06:12:47","guid":{"rendered":"http:\/\/truelogic.org\/wordpress\/?p=402"},"modified":"2011-03-17T23:12:47","modified_gmt":"2011-03-18T06:12:47","slug":"alter-change-the-width-height-skin-and-color-of-ckeditor","status":"publish","type":"post","link":"https:\/\/truelogic.org\/wordpress\/2011\/03\/17\/alter-change-the-width-height-skin-and-color-of-ckeditor\/","title":{"rendered":"Alter\/change the width, height, skin and color of CKEditor"},"content":{"rendered":"<p>Well to change the color or height or width or even change the whole look (skin) of CKEditor , we just need to keep in mind 1 file, and that is the &#8221; config.js &#8221; file in the ckeditor folder.<\/p>\n<p>Any changes made to the main config.js file will reflect on all the pages where the CKEditor has been used.<br \/>\nBut if you don&#8217;t want the changes to show on all the pages then you only need to add some code in the respective pages where you want the changes to happen.<\/p>\n<p>This code below will give you a nice idea about how to change the properties of your CKEditor using the config.js file<br \/>\n( code inside the config.js file is given below )<\/p>\n<div style=\"background: black; color: #f2f2f2; font-family: courier; padding: 8px; overflow-x:scroll;\">\n<pre>\n\nCKEDITOR.editorConfig = function( config )\n{\n\n\/\/ config.language = 'fr';                                                         \n\/\/ config.customConfig = '\/ckeditor\/config.js';     \n\/\/ config.toolbar = 'Basic';\n\/\/ config.uiColor = '#dfe8f6';\n\nconfig.height = 200;\nconfig.width = 250;\nconfig.skin = 'v2';      \/\/config.skin = 'office2003'; \n                             \/\/config.skin = 'kama';\n\nCKEDITOR.config.toolbar_Basic = [\n['Source','-','Templates'],\n['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],\n['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],\n['Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],\n'\/',\n['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],\n['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],\n['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],\n['Link','Unlink','Anchor'],\n['Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],\n'\/',\n['Styles','Format','Font','FontSize'],\n['TextColor','BGColor'],\n['Maximize', 'ShowBlocks','-','About']\n]\nconfig.toolbar = 'Basic';\nconfig.extraPlugins = \"insert_image\";\n};<\/pre>\n<\/p><\/div>\n<p>Below is the preview of the toolbar after making the above changes in the config file <\/p>\n<figure id=\"attachment_403\" aria-describedby=\"caption-attachment-403\" style=\"width: 140px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2011\/03\/configured_ckeditor.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2011\/03\/configured_ckeditor-140x300.png\" alt=\"\" title=\"configured_ckeditor\" width=\"140\" height=\"300\" class=\"size-medium wp-image-403\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2011\/03\/configured_ckeditor-140x300.png 140w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2011\/03\/configured_ckeditor.png 264w\" sizes=\"auto, (max-width: 140px) 100vw, 140px\" \/><\/a><figcaption id=\"caption-attachment-403\" class=\"wp-caption-text\">After changes made in the config.js<\/figcaption><\/figure>\n<p>Now let&#8217;s try changing only the color of the toolbar, for that you just have to write something like this in the config.js <\/p>\n<div style=\"background: black; color: #f2f2f2; font-family: courier; padding: 8px; overflow-x:scroll;\">\n<pre>\n\n\/\/ config.language = 'fr';\n\/\/ config.customConfig = '\/ckeditor\/config.js';\n   config.toolbar = 'Basic'; \n   config.uiColor = '#800040'; \n\/\/ config.height = 200;\n\/\/ config.width = 250;\n\/\/ config.skin = 'v2'; \n<\/pre>\n<\/div>\n<p>Now the toolbar will look something like this<br \/>\n<figure id=\"attachment_404\" aria-describedby=\"caption-attachment-404\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2011\/03\/color_changed_ckeditor.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2011\/03\/color_changed_ckeditor-300x127.png\" alt=\"\" title=\"color_changed_ckeditor\" width=\"300\" height=\"127\" class=\"size-medium wp-image-404\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2011\/03\/color_changed_ckeditor-300x127.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2011\/03\/color_changed_ckeditor-500x211.png 500w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2011\/03\/color_changed_ckeditor.png 949w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-404\" class=\"wp-caption-text\">Changed the color of the toolbar from the config.js<\/figcaption><\/figure><\/p>\n<p>But if you <em><span style=\"color: #f40000;\">don&#8217;t want the changes to be shown in every single page<\/span><\/em> where you have used CKEditor then you have to write a few lines of code in the individual pages where you want to change the properties of your CKEditor.<\/p>\n<p>In this case, I want the changes to show up only on one page called &#8220;test-editor.html&#8221;.<\/p>\n<p><span style=\"font: bold 18px arial;\">Case 1:<\/span> changing the skin only <\/p>\n<div style=\"background: black; color: #f2f2f2; font-family: courier; padding: 8px; overflow-x:scroll;\">\n<pre>\n&lt;!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 strict\/\/EN\"&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;title&gt;Truelogic.org::TestEditor::CKEditor example &lt;\/title&gt;\n\n&lt;script type=\"text\/javascript\" src=\"ckeditor\/ckeditor.js\"&gt;&lt;\/script&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n\n\t&lt;form name=\"\" action=\"\" method=\"\"&gt;\n\t &lt;textarea id=\"txtDescrip\" name=\"txtDescrip\" cols=\"20\" rows=\"5\" class=\"ckeditor\"&gt;&lt;\/textarea&gt;\n\n\t&lt;script type=\"text\/javascript\"&gt;\n\t\tvar editor = CKEDITOR.replace( 'txtDescrip',\n\t\t{\n\t\t\ttoolbar : [\n\t\t\t\t\t\t['Source','-','Templates'],\n\t\t\t\t\t\t['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],\n\t\t\t\t\t\t['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],\n\t\t\t\t\t\t['Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],\n\t\t\t\t\t\t'\/',\n\t\t\t\t\t\t['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],\n\t\t\t\t\t\t['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],\n\t\t\t\t\t\t['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],\n\t\t\t\t\t\t['Link','Unlink','Anchor'],\n\t\t\t\t\t\t['Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],\n\t\t\t\t\t\t'\/',\n\t\t\t\t\t\t['Styles','Format','Font','FontSize'],\n\t\t\t\t\t\t['TextColor','BGColor'],\n\t\t\t\t\t\t['Maximize', 'ShowBlocks','-','About'],['insert_image']\n\t\t\t\t\t],\n\t\t\tskin : 'office2003',  \/\/ ALTERED THE SKIN HERE \n\t\t});\n\t&lt;\/script&gt;\n\n\t&lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n\n<\/pre>\n<\/div>\n<p><span style=\"font: bold 18px arial;\">Case 2:<\/span>  changing the height, width and the color of the toolbar<\/p>\n<div style=\"background: black; color: #f2f2f2; font-family: courier; padding: 8px; overflow-x:scroll;\">\n<pre>\n&lt;!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 strict\/\/EN\"&gt; \n&lt;html&gt;\n&lt;head&gt;\n&lt;title&gt;Truelogic.org::TestEditor::CKEditor example &lt;\/title&gt;\n\n&lt;script type=\"text\/javascript\" src=\"ckeditor\/ckeditor.js\"&gt;&lt;\/script&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n\n\t&lt;form name=\"\" action=\"\" method=\"\"&gt;\n\t &lt;textarea id=\"txtDescrip\" name=\"txtDescrip\" cols=\"20\" rows=\"5\" class=\"ckeditor\"&gt;&lt;\/textarea&gt;\n\n\t&lt;script type=\"text\/javascript\"&gt;\n\t\tvar editor = CKEDITOR.replace( 'txtDescrip',\n\t\t{\n\t\t\ttoolbar : [\n\t\t\t\t\t\t['Source','-','Templates'],\n\t\t\t\t\t\t['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],\n\t\t\t\t\t\t['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],\n\t\t\t\t\t\t['Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],\n\t\t\t\t\t\t'\/',\n\t\t\t\t\t\t['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],\n\t\t\t\t\t\t['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],\n\t\t\t\t\t\t['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],\n\t\t\t\t\t\t['Link','Unlink','Anchor'],\n\t\t\t\t\t\t['Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],\n\t\t\t\t\t\t'\/',\n\t\t\t\t\t\t['Styles','Format','Font','FontSize'],\n\t\t\t\t\t\t['TextColor','BGColor'],\n\t\t\t\t\t\t['Maximize', 'ShowBlocks','-','About'],['insert_image']\n\t\t\t\t\t],\n\t\t\tuiColor: 'red', \n\t\t\theight: 200,\n\t\t\twidth: 700,\n\t\t});\n\t&lt;\/script&gt;\n\n\t&lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n\n<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Well to change the color or height or width or even change the whole look (skin) of CKEditor , we just need to keep in <a class=\"mh-excerpt-more\" href=\"https:\/\/truelogic.org\/wordpress\/2011\/03\/17\/alter-change-the-width-height-skin-and-color-of-ckeditor\/\" title=\"Alter\/change the width, height, skin and color of CKEditor\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,8,10,11],"tags":[33,43,61,67,75,77,138,237,248,252,273],"class_list":["post-402","post","type-post","status-publish","format-standard","hentry","category-javascript","category-misc","category-programming","category-tutorials","tag-alter","tag-arunace","tag-change","tag-ckeditor","tag-color","tag-config","tag-height","tag-skin","tag-theme","tag-toolbar","tag-width"],"_links":{"self":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/comments?post=402"}],"version-history":[{"count":0,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/402\/revisions"}],"wp:attachment":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media?parent=402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/categories?post=402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/tags?post=402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}