Archived blog with a focus on DotNetNuke news, tips and tricks, DNN SEO, and insights and opinions about the DNN community at large.

First time here? You may want to check out the blog archive, subscribe to the RSS feed, sign up for free email updates, or follow me on Twitter. Thanks for visiting!

Customizing FCKeditor Toolbars 

FCKeditor has been the default rich-text editor for DotNetNuke for quite a while now. I find it mostly intuitive and easy-to-use right out of the box. It provides more functionality than most website administrators will ever need and behaves much like any familiar Microsoft office application. There are times, however, when you’ll want to trim back some of that capability to avoid confusing your website users.

For example, we use Active Forums on liftkettlebells.com. We intended to give our users some limited text formatting ability, but the default FCKeditor includes a whopping 48 toolbar buttons! Frankly, it looks too busy and no one uses all those buttons when drafting a forum post. We just wanted to offer our visitors a few obvious options to pretty up their posts: bold, italics, bullets, lists, and hyperlinks.

One approach is to make modifications to your toolbars in the fckconfig.js file located in \Providers\HtmlEditorProviders\Fck\Custom, but those changes are then applied globally. I suggest using this method if you want to add/delete single buttons on the toolbars themselves. Let’s save those details for a future blog post.

For now, let’s focus on "hiding" toolbars using the FCKeditor's custom options page. If you are logged in as a host or admin, you will see a Show Custom Editor Options link below the compose window of any FCKeditor instance.

In Active Forums, for example, pick any forum and click the Add New Topic button. Then click Show Custom Editor Options.

Notice the three Settings Type options: Instance, Module, and Portal. These options are meant to confine your custom settings to a single instance of FCKeditor, to every instance within the current module, or portal-wide to every module and instance on your website. Unfortunately, it often doesn’t quite work that way. You may need to experiment with your selection to get the intended results. In this case, I’ve found that Instance modifications actually push my changes out across the entire Active Forums module. A little counter-intuitive to say the least!

Select Editor Toolbar View Options to view your toolbar choices. This is where you "turn off" unwanted toolbars. Select the pencil icon to expand the selected toolbar. For example, DNNDefault. Note, you may need to scroll back down to the Editor toolbar view options section after clicking the pencil icon.

You can disable the toolbar for all users, or a selected subset of users based on role. For our forum, I checked Disabled for All Users. Attention, you must click on the check mark image to the left of the row for your changes to take affect. This is another quirky little detail that took me a few hours to figure out!

You will need to repeat these steps for each toolbar you want to disable. So, I also disabled the Default and NoGallery toolbars. That leaves only the desired Basic toolbar visible to our users.

Once you have disabled the unwanted toolbars, click Apply in the Apply Custom Settings To section with Instance selected in the dropdown box. You should then see a “Settings applied successfully to Instance” message as shown below.

Now close the dialog box. To see your changes, don’t forget to click Refresh Editor at the bottom of the compose window.

And that’s it! These changes are only applicable to Active Forums. So, when I’m editing content using any other modules, I still have access to the full suite of toolbars. But, my forum members get to see a simpler, smaller set of formatting choices:

We would love to hear from you. What have you learned while customizing the FCKeditor for your needs? Please share in the comments below.

 




Comments

Jeff Jeff says:

Looks great!

Prettty much the same way I do it. Didn't know about the "instance issue" with AF though. With so many instances of FCK in my website, as I'm sure others in the DNN community could say the same, I just wish there was one central location to make customizable changes to FCK rather than having to navigate to each instance. Maybe some day.........

Any chance on digging deeper into FCK and explain more of the configuration options?

Tom Kraak Tom Kraak says:

Thanks Jeff.

What specific "configuration options" would you like us to cover?

Kire Kire says:

how about covering how to make FCK a true WYSIWYG editor. Currently the style in the editor window isn't necessarily what will show up when you save. An overview of how to sync those styles up would be cool. Also you should cover how to control the styles available in the dropdown box.

Heidi Waters Heidi Waters says:

Thanks for the great comments! I will definitely be digging in deeper to the functionality of FCK editor and customization strategies in future posts.

Sara Sara says:

Thanks Heidi. I had discovered these options, but they are pretty confusing, like you said. This helps a little, although I'm still fuzzy on just what the Instance option changes, as well as why there are two place to choose instance vs. portal (above the box where you choose the toolbars and in the Apply section).

I agree with Kire, I'd love to know how to make this a true WYSIWYG editor. The clients for whom we develop sites are mostly not web savvy, and the way DNN handles module editing is a little clunky.

Unfortunately we had to ditch FCK altogether because it wouldn't work on any Mac browser. That's too bad because the alternatives aren't quit up to snuff: We tried the Rad editor (inconsistent functionality between IE and Firefox) and the Cute editor (applies all classes in span tags and creates divs instead of paragraph tags). We decided to go with Cute because it was the lesser of two evils, but it isn't as flexible as FCK.

I apologize for the long post, but I have one more point. It seems IE doesn't like to allow text editors to place paragraph tags, which to me are essential in styling a site. Has anyone else encountered this, or found ways around it? Thanks.

Will Sugg Will Sugg says:

Hi Heidi,

Thanks for this but it is not working for me. I cannot get the disable check to 'take' no matter what I do. I have tried using FF and IE browser, instance, module, etc. Your pic here http://seablick.com/portals/0/images/blog/editor-options-page.gif
has those checks beside the toolbars you do not currently have selected to edit. I cannot get those changes to 'stick' - am I missing something?

thanks,

Will

Heidi Heidi says:

Thanks Will - what module are you trying to make your edits in? It may be something module-specific, rather than with FCK editor. You also have to do each toolbar one at a time: select the pencil icon, check disable, check which role (such as All Users), then select the check all the way to the left. Do this for each toolbar. You probably already did this, but I figured I'd reiterate if you swapped the order or something.
Please keep me posted on how this works for you!
Heidi

Déclic Vidéo FX Déclic Vidéo FX says:

Currently, when I write an article in FCK, it does not look like the same way than when I publish the article... That would be great to know how we can modify FCK (or whatelse), so we can have the exact same thing between when you write, and what you publish...

DV FX

Will Sugg Will Sugg says:

Thanks! Yes, the problem was that pesky far left arrow. After disabling tool bar, then go far left and click that one. Do all and then saved worked! Also, you were correct about instance vs. module - I tried module and no joy and instance worked.

thanks again,

Will

Rodney Joyce Rodney Joyce says:

Hi Tom,

I've blogged about some changes I made to the FCK editor for PokerDIY that your readers may be interested in:
http://www.smart-thinker.com/DNNBlog/tabid/1070/EntryID/35/Default.aspx

Specifically, how to reduce the number of icons a toolbar, and how to add custom smileys.

Tom Tom says:

Is there a way to customize all of FCK all at once??
We want to add and remove some styles from the list, as well as remove some toolbars.
I'll ask on the DNN forum too.
Thank you, Tom

Heidi Waters Heidi Waters says:

Thanks Rodney! Really enjoyed your article, especially "the hardest part was finding the right file to change and fighting my browser cache". The browser cache issue is my biggest headache - for anyone who doesn't know what this is, you have to refresh your browser cache after every change, and if you forget, you'll be tearing your hair out, trying to figure out why your change didn't work!

I've also found there's a lot of redundancy in file names, you have to be meticulous with what you change, and keeping original copies of files.

TWS TWS says:

My FCKeditor tool bar as all the images in it but it also has lots of text. How do you take the text portion out. I want mine to look that the first example above,

NIRAJ NIRAJ says:

HELLO ALL,

I am running this fckeditor in sharepoint but while uploading the image into the list it gets context of root site only , while i need the context of subsite as the fckeditor is running under the subsite url and the document library where the document has to be uploaded is also in subsite.

Comments are closed

Subscribe to our Feeds Follow on Twitter