Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rich Text Editor form helper plugin for CFWheels.
JavaScript ColdFusion
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
editors
richtext
README.textile
RichText.cfc
index.cfm

README.textile

Rich Text Form Helpers

This plugin will add 2 new form helpers that will display a Rich Text Editor and still use the built-in Wheels validations on it.

Currently only the Mark-it-up editor and ckEditor are supported and both require jQuery.

Instructions

  1. Make sure you have the default “files” folder created in the root of your wheels application.
  2. Copy the folder for the editor you want to use from the plugins/richtext/editors directory into the /files/plugins/richtext directory under the root of your Wheels application.

You should end up with the following:


/files/plugins/richtext/nameofeditor

Syntax

The RTE form helpers take the same arguments as textArea and textAreaTag helpers with a few additions. The richTextField() helper is the same as the textArea() helper and requires the objectName and property attributes. The richTextTag() helper is the same as the textAreaTag() helper.

#richTextField(objectName='snippet', property='content', class="rteditor", rows="15", editor="markitup", includeJSLibrary="false")#
        
#richTextTag(name="content", class="rteditor", rows="15", editor="markitup", includeJSLibrary="false")#

A couple things to note. The “editor” argument tells the method which style of editor to use. The includeJSLibrary argument is used to tell the method wether or not it should include the base javascript library file required by the editor. It defaults to TRUE and in the case of Mark-It-Up it will include a call to the jquery library in the HTML HEAD section. If you are already including jquery in your application for other functionality, just set this to FALSE.

You MUST use the class argument of ‘rteditor’ in order for the rte to be invoked.

The editor attribute can be either ‘markitup’ or ‘ckeditor’

If using ckEditor, you can pass an addition attribute called ‘options’ which gets passed into the the editor for configuration. For instance, you can define your own toolbar according the ckEditor docs and then pass those options in as a string.

Something went wrong with that request. Please try again.