Welcome!

ColdFusion Authors: Yakov Fain, Maureen O'Gara, Nancy Y. Nee, Tad Anderson, Daniel Kaar

Related Topics: ColdFusion

ColdFusion: Article

Activedit 2.5 by CfDev.com

Activedit 2.5 by CfDev.com

Some time ago, when Homesite 1.0 was still my editor of choice (yes, that long ago), I had a problem with a client. A small-town newspaper editor wanted a wider audience - the Web.

Naturally, she knew nothing about HTML or FTP, and she wasn't about to learn. I thought, "Create a database." I could use an HTML form to collect the text and, voilà, instantly updated pages. But how could she format the text without learning <br> and <b>?

The boss nixed the idea as too expensive and time-consuming. I probably wasted enough time converting her text to do the database option twice. But I'm not paid to make the Big Decisions.

Actually, I couldn't get the problem out of my mind. A client with no other knowledge (except how to get online and how to use a word processor) needed to be able to create and edit HTML documents on a remote server. The only solution is a Web-based WYSIWYG editor that can save in HTML.

Problem solved. Activedit 2.5 from CFDev.com does the trick. You get a fully functional HTML editor that you just plug into a form.

Installing Activedit
If you have access to your own server, or if your Web space provider is nice enough to install it, you'll be in business fast. Note: To use the spell-check feature, you'll need a Java Virtual Machine (the documentation recommends the Java 2 Runtime                        .Environment, available at http://java.sun.com/products/).

Even if you don't have access to your server's custom tags folder, you can still use Activedit. Simply upload the activedit.cfm file to the folder where you'll be using it. You'll also need to upload the /inc folder that contains support files.

In my test I used the nonserver method at my host. As far as I could see, there was no discernible difference in performance.

Using Activedit
Activedit is a CF custom tag that you include in any CF form page. It creates a text editor inside your form. Activedit, at its simplest, looks like this:

<cf_activedit fieldname="contents"
inc="inc/"></cf_activedit>

To explain what you're seeing: "fieldname" is simply that - the name of the form field. That fieldname gets passed, HTML code and all, into your form handler; "inc" is the folder containing Activedit's components and image files. If you want to include some predefined input, it can be inserted via a CF variable. Other attributes allow you to modify the toolbar or enable and disable different options.

From this point, assuming you don't need to allow image uploading or spell checking, you can use the basic tag as if it were a <textarea> form tag. Add an appropriate CFFILE tag in your form handler, like so:

<cffile action="write" file="#destination_dir#\content.html" nameconflict="overwrite" output="#form.contents#">

Now you have a perfectly usable HTML editor inside your form that writes to a static HTML page. Of course, you can also save the results into a memo field in your database or to an e-mail. You may want to include a validator to extract any potentially harmful code. I was able to paste a little JavaScript into my form. Setting "alloweditsource=no" would probably take care of it.

On the other hand, your more savvy clients may appreciate being able to add tables and hyperlinks.

Unfortunately, space doesn't permit me to go into all the details of this product. I haven't even touched on the Java-based spell checker or image uploading.

Who can best use this? Honestly, if you maintain a Web site, whether your own or a few dozen for your clients, Activedit can dramatically alter the way you do business. Imagine a Web site like the one I mentioned at the outset: a newspaper editor needs weekly (maybe daily) updates. Imagine she can edit her site online and you never have to hear from her (except for the checks). Or imagine sending formatted HTML e-mails using your client database. Imagine a Web site where users can browse and create and maintain their own personal Web pages without ever calling or e-mailing you.

Is Activedit worth it? If you want hassle-free content management and reduced customer hand-holding, it's the way to go. But to me, just the "wow" factor would be worth the money.

VITALS
Activedit 2.5
CFDev.com
Address: 181 Genesee Street
Suite 500
Utica, NY 13501
Web: www.CFDev.com
Phone: 800 791-1916
Test Environment: NT4 server with IIS and CF4.5
Pricing: I tested an open source version with spell checker for $475. The basic ColdFusion version is $99 ($175 with spell checker).

More Stories By Carey Lilly

Carey Lilly is an associate with a Web site– development firm based in the New York area. He has been developing with ColdFusion since 1997 and has 10 years’ experience with relational databases.

Comments (4)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.