How Do I Enable the WYSIWYG Editor?
Please note that wysiwyg editing is only available in GridMonger v4.60 and up, which is currently limited to registered GridBuilder users.
It doesn't take much to enable the wysiwyg editor in GridMonger, but you do have to roll up your sleeves a bit. Everything but the urls and paths listed below are set to values you don't have to mess with unless you choose to do so.
- First of all, grid config files ordinarily have this line in them, Usually somewhere around Line 18
request.GridMonger=StructNew();
Delete this line. We'll need to initialize this structure outside odf the grid for reasons that will become clear further down the page.
- Next, go into GridMonger's /Application.cfm. The first thing you should notice is that the line you just deleted in the previous step is here in this file on Line 15 or thereabouts. Comments in the code on this file should explain everything there. The next items that concern us begin in the area of Line 32.
- Set the variable client.ImageFTPPath to the physical path where your images are located. Or more descriptively, to the location on your server's hard drive where you want the editor's file and image browsers to pull images from, and upload new images to (assuming uploading will be allowed, which we'll decide further on). For example:
client.ImageFTPPath="c:/cfusionmx/wwwroot/gridmonger/images/";
- Set the variable client.ImageURLPath to the web-accessible URL that corresponds to the location set in Step 3 above. Example:
client.ImageURLPath="http://gridmonger.com/images/";
- Set the variable client.BasePath to the web-accessible url that contains the root of the wysiwyg editor's installation. The default is to have this folder immediately off the web root, like so:
client.BasePath="http://gridmonger.com/fckeditor/"; Note that if you change this location or rename it you will also have to change the locations of the file/image browsers and uploaders. This is not recommended unless you understand how the wysiwyg editor is configured internally, and some types of changes will break the uploaders' functionality. Don't get fancy.
- Next you need to decide if a user can browse your server for files or images, and whether or not they can upload images to your server. This is controlled by client.CanBrowse and client.CanUpload. Leaving the values blank ENABLES the choice. Putting anything in these variables disables the choice.
- If the user can browse and upload, what exactly will be allowed? The ColdFusion uploaders and browsers that ordinarily come with the wysiwyg editor have been enhanced to include window-resizing, error trapping and MIME-type checking (Russell Patterson also added in list scrolling). The MIME types that will be allowed are listed here, where client.FileTypes controls the file uploads and client.ImageTypes controls the files allowed in the image dialog. Note that images are included in the file type list so that you can link to an image (file uploads are accessed through the Link dialog). The defaults are as follows. Change them as you see fit:
Images |
Files |
- image/gif
- image/jpg
- image/jpeg
- image/pjpeg
- image/tiff
- image/x-png
- image/x-MS-bmp
- application/x-shockwave-flash
|
- image/gif
- image/jpg
- image/jpeg
- image/pjpeg
- image/tiff
- image/x-png
- image/x-MS-bmp
- text/plain
- application/vnd.ms-excel
- application/msexcel
- application/msword
- application/x-zip-compressed
- application/pdf
- video/x-ms-wmv
- application/x-shockwave-flash
| Note that the wysiwyg editor also provides simple extension checking. If you change the list above you may need to edit /fckeditor/js/fck_config.js.
- Another addition we have made to the ColdFusion uploaders is to install file size checking. The maximum file size is specified in bytes in client.MaxFileSize. The default is 1 megabyte.
Those are all of the GridMonger settings. But wait, you may not be done yet. What if the toolbars we have set up as defaults (we created three of them in /fckeditor/js/fck_config.js) don't suit you? Making your own is very easy. The format is simple to follow and we trust that you will have no trouble moving things around as you see fit to give yourself exactly the editor you want.
Finally, if you really want to crawl under the hood of the wysiwyg editor, hfeel free to have at it. FCKEditor is an open-source tool that is unencrypted. You will find most configuration settings in /fckeditor/js/fck_config.js. Also the author's web site has a robust and active support forum. Enjoy!
|