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.
- Make sure you have the default “files” folder created in the root of your wheels application.
- 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:
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")#
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.