{"id":168,"date":"2010-05-30T06:39:22","date_gmt":"2010-05-30T10:39:22","guid":{"rendered":"http:\/\/erics-test-lab.com\/?p=168"},"modified":"2010-05-30T06:39:22","modified_gmt":"2010-05-30T10:39:22","slug":"cftextarea-richtext-editor","status":"publish","type":"post","link":"https:\/\/www.esearing.com\/v2010\/2010\/05\/cftextarea-richtext-editor\/","title":{"rendered":"CFTextArea richtext editor"},"content":{"rendered":"<p>I am toying with a new application that lets folks collaborate on a document online. Kind of like Basecamp&#8217;s write board but perhaps not as dynamic. I needed to build a form with a rich text editor to let the users have some tools to mark up the document. Fortunately Coldfusion offers CFTextArea with the optional richtext.<\/p>\n<p><code>&lt;cftextarea name=\"mytxt\" richtext=\"y\" toolbar=\"Basic\"  height=\"300\" width=\"500\"&gt;<\/code><br \/>\nThe toolbar attribute allows for a choice of <strong>basic<\/strong> (bold, Italic, link, ol, ul) or <strong>default<\/strong> which has everything except the kitchen sink. What I wanted was something in between. Fortunately I found a couple articles about modifying the available toolbars. But none seemed to work. Then I found a script* which does the same thing except you put it after your form in a cfm. The script overwrites the chosen editor and replaces it with your custom one. I customized the form elements I wanted by looking at the fckeditor fckconfig.js file.<\/p>\n<p><code>&lt;script&gt;<br \/>\nfunction FCKeditor_OnComplete(editorInstance)<br \/>\n{<br \/>\neditorInstance.Config[\"ToolbarSets\"][\"BasicPlus\"] = [<br \/>\n['SpecialChar','Bold','Italic','Underline','StrikeThrough','Link', 'Unlink','-','Cut','Copy','Paste', 'Find','Replace',<br \/>\n'-','FontFormat','FontSize','TextColor']<br \/>\n];<br \/>\neditorInstance.EditorWindow.parent.FCK.ToolbarSet.Load('BasicPlus') ;<br \/>\n}<br \/>\n&lt;\/script&gt;<\/code><br \/>\nwhich gives this editor toolbar (click image to see larger).<br \/>\n<a rel=\"attachment wp-att-172\" href=\"http:\/\/erics-test-lab.com\/2010\/05\/cftextarea-richtext-editor\/rteditor\/\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-172\" title=\"rteditor\" src=\"http:\/\/www.esearing.com\/v2010\/wp-content\/uploads\/2010\/05\/rteditor-300x21.jpg\" alt=\"custom fckeditor Richtext Toolbar\" width=\"300\" height=\"21\" srcset=\"https:\/\/www.esearing.com\/v2010\/wp-content\/uploads\/2010\/05\/rteditor-300x21.jpg 300w, https:\/\/www.esearing.com\/v2010\/wp-content\/uploads\/2010\/05\/rteditor.jpg 603w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>* Script modified from <a href=\"http:\/\/articleadvocates.com\/ArticleAdvocates\/Display.cfm\/5619\">this article<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am toying with a new application that lets folks collaborate on a document online. Kind of like Basecamp&#8217;s write board but perhaps not as dynamic. I needed to build a form with a rich text editor to let the &hellip; <a href=\"https:\/\/www.esearing.com\/v2010\/2010\/05\/cftextarea-richtext-editor\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-168","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/comments?post=168"}],"version-history":[{"count":0,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/posts\/168\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/media?parent=168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/categories?post=168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esearing.com\/v2010\/wp-json\/wp\/v2\/tags?post=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}