|
CKEditorFormControl
IntroductionThis is an addon to Share forms that lets you use the CKEditor as a wysiwyg editor for online edits. CKEditor, http://ckeditor.com/, is a separately developed tool, this addon provides the integration to Alfresco forms. CKEditor is GPL, LGPL MPL Triple copy left licensed.
Features
UsageThe control should appear when you create a new html file, or edit an existing html file online. To insert images from a Share site, select the images button, and then Browse Server. InstallationThe CKEditor form control is packaged as a single JAR file for easy installation into Alfresco Share. To install the control
Forms configurationIn you forms configuration file, under apperance, add <appearance>
<field id="cm:content">
<control template="/org/alfresco/components/form/controls/ckeditor.ftl">
<control-param name="forceEditor">true</control-param>
</control>
</field>
</appearance>To load a custom javascript based file use <appearance>
<field id="cm:content">
<control template="/org/alfresco/components/form/controls/ckeditor.ftl">
<control-param name="forceEditor">true</control-param>
<control-param name="settingsfile">components/editors/ckeditor/my-config.js</control-param>
</control>
</field>
</appearance>Path to custom settings file should not have a starting /. More information on how to create custom configuration files can be found in http://docs.cksource.com/CKEditor_3.x/Developers_Guide. Use the http://share-extras.googlecode.com/svn/trunk/CKEditor%20Form%20Control/source/web/components/editors/ckeditor/config.js as a template. Loading forms dependenciesThe ckeditor-form-control.jar includes configuration to load javascript dependencies. However if you have other configuration in a custom config file this may overwrite this configuration. Only do this step if CKEditor fails to load. <config> <forms> <dependencies> <!-- Include some extra assets --> <js src="/modules/editors/ckeditor/ckeditor.js" /> <js src="/components/editors/ckeditor/ckeditorloader.js" /> </dependencies> </forms> </config> If you notice that the above javascript files do not load when creating or editing an html file, merge this configuration to your share-config-custom.xml file. Indication that this is happening is that the textarea is blank and the editor has failed to load. Building from sourceCheck out the project if you have not already done so svn checkout http://share-extras.googlecode.com/svn/trunk/CKEditor%20Form%20Control Change into the new directory cd "CKEditor form control" An Ant build script is provided to build a JAR file containing the custom files, which can then be installed into the tomcat/shared/lib folder of your Alfresco installation. To build the JAR file, run the following command from the base project directory. ant clean dist-jar The command should build a JAR file named ckeditor-form-control.jar in the dist directory within your project, which you can then copy into the tomcat/shared/lib folder of your Alfresco installation. Alternatively, you can use the build script to hot deploy the JAR file directly into a local Tomcat instance for testing. You will need to use the hotcopy-tomcat-jar task and set the tomcat.home property in Ant. ant -Dtomcat.home=C:/Alfresco/tomcat clean dist-jar hotcopy-tomcat-jar After you have deployed the JAR file you will need to restart Tomcat to ensure it picks up the changes. Known IssuesNone at this time. Future EnhancementsPossible to add more out of the box configuration settings. Filters in image browser. External Components
ContributionThis form control was contributed by Peter Löfgren, http://loftux.se (Swedish) http://loftux.com (English) | |
To get a larger preview, click the thumbnail image. To select an image, click the name.
Peter -- I installed this component and I was wondering if CKEditor is supposed to automatically replace TinyMCE when I Create Content (HTML) in the document library or is the scope only as a Share Forms component? The following line above led me to think think this might be possible OOTB: "The control should appear when you create a new html file, or edit an existing html file online." I tried it, but I get the TinyMCE editor when I create content in the document library. Thanks.
The CKEditorFormControl is only available to Alfresco Share, not Alfresco Explorer. For Alfresco Share, for the control to appear when creating new files, find the <config evaluator="model-type" condition="cm:content"> section and the generic <form> and change the appearance for cm:content field as per the instructions. For editing, the section is <config evaluator="node-type" condition="cm:content"> and form id <form id="doclib-inline-edit">. This should make the CKEditor appear for both Share Repository and Share Collaboration Document Library. If not, please file an issue.
Hi,
Really nice add on ! We're trying to set it up, however, I can't get where that 'site=demo' in the upload URL is coming from..
I have a space in alfresco that I want to browse, what am I supposed to put in the config file of ckeditor for the following parameter :
I'm really stucked deep in this, any help appreciated
thanks
Mat
In the default config.js the client side constant: Alfresco.constants.SITE is used, that is populated with the current site id. I suggest you used that. Also check out and build the project yourself if you haven't done so, the compiled jar is unfortunately a bit outdated, I'll try to update this as soon as I have time.