Net-Teams, Inc.
HOME | Membership Websites | SMM Solutions | CRM Solutions | Online Training Systems | Publishing | Clients | Guarantee | Log In

Customizing the FCKeditor Tool Bar in ColdFusion - CFTextArea

Submitted by Teo Graca | RSS Feed | Add Comment | Bookmark Me!

The configuration file is generally located on the server at /CFIDE/scripts/ajax/FCKeditor/fckconfig.js and there is a "Default" and "Basic" configuration built in. These are referenced in the cftextarea tag with the "toolbar" parameter as in:

Note in the example above that we are that we are passing in the data with the "s_det" variable and the cftextarea tag uses pixels to size the form element instead of the HTML textarea form element rows and cols attributes. You can define additional toolbar sets in this file. The "Basic" definition below is defined in the "fckconfig.js" file (see below).
FCKConfig.ToolbarSets["Basic"] = [
	['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;
Predefined Basic Toolbar

We use a custom set of tools in our Toolbar for the Article Advocates as follows:
FCKConfig.ToolbarSets["MyToolBar"] = [
 ['SpecialChar','Bold','Italic','Underline','Subscript','Superscript','SpellCheck','Link'],
 ['OrderedList','UnorderedList','Outdent','Indent'],
 ['TextColor','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
 ['FontFormat','FontName','FontSize','TextColor']
] ;
Note that the '-' provides verticle line within the toolbar items and the '/' creates line break. Also, the brackets encompasing the list of tools creates logical sections so that if you remove the line breaks ('/'), the line breaks will occur naturally around the bracket groups as they fit within the editor, so that several groupings may appear on one line.

Toolbar Example

The call to this toolbar from the cftextarea tag would be:

Another technique you can use to customize the toolbar in cases where you don't have access to the fckconfig.js file, is to define the toolbar after the page has loaded. We will use the MyToolBar example above. You can put the following code in the page with the form.

The default or basic tool bar will load, and then be replaced by MyToolBar as defined above. This later technique has solved a lot of issues for us since the FCKeditor became available with ColdFusion in cases where we work with websites on shared servers. I hope you find this useful.

Note that the predefined "Default" toolbar has a complete set of options available for the editor. You can grab these and define just the tools you want within your custom toolbar.

FCKConfig.ToolbarSets["Default"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks','-','About'] // No comma for the last row.
] ;


Contact Us
Support and Sales
Contact Us

LinkedIn Recommendation: Carl Madden - Search Engine Marketing Consultant at Osato Tree - There are many times I have been stuck on something, but now I that I am working with Teo Graca, I know I can get unstuck quickly. He has a way of getting at the meat of the solution to any problem when it comes to business planning. I really don't know anyone with such a well rounded skill set. I think that is what makes it possible for him to do what he does. I highly recommend Teo and Net-Teams! - March 15, 2012, Carl was Teo's client

Welcome!

Search Articles On Net-Teams

Featured [FCKeditor] Articles:
Net-Teams - Helping Businesses Prosper With Custom CRM, SMM and Online Training - Net-Teams, Inc. (NTI) is a technology and marketing firm and offers access to a core set of system t...
The Benefits Of A Membership Program For Your Website - Building membership through your website allows you to automate the acquisition of prospects and cus...
eWorkshop Hosting - The More Effective Way to Build Your Business with Online Ed - More and more companies are using eWorkshops to reach out to customers, prospects and employees. An ...
eWorkshop Publishing From Net-Teams - As many people are discovering, self-publishing is a time consuming venture, which takes time away f...
What is Social Media Management And Why Is It So Critical? - Whether or not you have a customer relationship management (CRM) system in place, there is one key r...

Related Tags (related articles): FCKeditor (1), ColdFusion (3), fckconfig.js (1), Config (4), CFTextArea (1), Tool Bar (2), ToolBar (8)