Aloha Editor Gentics Content.Node Integration

There are serval Aloha Editor plugins that allow the integration of Aloha Editor with Gentics Content.Node.

1 Loading Aloha Editor

Load the Aloha Editor should always be done with URLs starting with /CNPortletapp/latest/…. Those URLs will be answered with a HTTP redirect to the URL containing the build timestamp of the Aloha Editor versioned currently contained in the Backend. This ensures that

  • URLs to load Aloha Editor do not change when updating the Backend
  • Browsers will cache different versions of Aloha Editor differently, so after an update of the Backend, it is no longer necessary to clear the browser cache to load the currently contained version of Aloha Editor.

1.1 Issues when using https://

When using an additional Web Server to handle SSL (https://) that forwards the requests to the Backend Apache with http:// the redirect will be done with http:// also, because the redirector does not know about https://. To handle such situations, there are two features, that can be used:

If the feature redirect_check_referer is turned on, the redirector will check the Referer URL, and use the schema and hostname from it. In cases, where the Referer might be missing, the feature redirect_assume_https will always enforce the redirect to https:// and the hostname from the Host request header.

An example configuration could look like this


// check the Referer for https:// and hostname
$FEATURE["redirect_check_referer"] = true;
// always assume the originating request to be https://
$FEATURE["redirect_assume_https"] = true;

2 Aloha Editor Plugins

2.1 Gentics Content.Node Integration Plugin gcn/gcn

The Aloha Editor Gentics Content.Node Integration Plugin allows Gentics Content.Node to use Aloha Editor for editing page contents. Settings are provided automatically and must not be changed by implementation. The plugin will also place tagicons in the content if Contenttags are used. Also delete icons are provided which make it possible to remove a contenttag from a page.

If a tagicon is clicked Gentics Content.Nodes Tagfill dialog is opened in a lightbox allowing you to update a Contenttags contents. If a delete icon is clicked the corresponding contenttag will be removed from the page and it’s underlying data model. If contenttags are removed by any other means (eg. selecting and deleting them using the Del key on your keyboard) they will be removed from the contents, but not from the pages data model.

If you use the Tagfill dialog to paste HTML contents from Microsoft Word, another Webpage or even code you created or modified yourself Aloha Editor will not be able to filter and clean those. Your HTML code will be inserted directly into the editable and may lead to undesired results.

3 Configuration

The tag insert buttons within the insert tag can be configured per editable. A whitelist configuration is used to show/hide specific tag insert options. The whitelist uses the tagtype keyword to filter the buttons/menu. This enables the system administrator to further define which tags options can be used for editors.

Example configuration:

node.conf

// this resembles the default configuration of available
// constructs for all editables 
$ALOHA_SETTINGS_NODE[1]['plugins']['gcn']['config'] = 
	array("tagtypeWhitelist" => array("link", 
		"wikilink",
		"formspace", 
		"htmllang",
		"myuncategorizedtagtype")
	);

// if you want to have a specific set of constructs
// you have to configure it using the "editables" key
$ALOHA_SETTINGS_NODE[1]['plugins']['gcn']['editables'] = 
	array(
		"#customEditableId" => 
			array("tagtypeWhitelist" => 
				array("myuncategorizedtagtype")
			),
		".header" => 
			array("tagtypeWhitelist" => 
				array("link", 
					"seitentag", 
					"download", 
					"upload")
			),
		"#GENTICS_METAEDITABLE_page_name" => 
			array("tagtypeWhitelist" => 
				array("fileurl",
					"breadcrumb",
					"lswitch")
			)
	);

3.1 Gentics Content.Node Fileupload Plugin gcn/gcnfileupload

The Gentics Content.Node Fileupload Plugin allows you to upload files by adding a button to the FloatingMenus “Link” tab. If you click the “Upload File” button a prompt will appear asking you to select a file. You may also add a description for your file. The file will be linked as soon as the upload finishes.

3.2 Gentics Content.Node Image Plugin gcn/image

The Gentics Content.Node Image Plugin is currently used to edit images from the backend and is not designed to be used with standard Aloha Editor inline editing.

3.3 Gentics Content.Node Linkbrowser Plugin gcn/linkbrowser

The Gentics Content.Node Linkbrowser Plugin will interface the Repository Browser with Gentics Content.Node so that pages, images and files from the Gentics Content.Node Backend can be selected.

4 Experimental Features

You may use a the latest experimental version of the gcn/gcn-plugin. The latest version will use the newly developed Gentics Content.Node Javascript Library.

You need to change the directory gcn with the gcn-gcnjslib. We suggest to use the following commands:


cd /Node/tomcat/webapps/CNPortletapp/20120314-145222/alohaeditor-0.10/plugins/gcn
mv gcn gcn-no_gcnjslib
mv gcn-gcnjslib gcn

The folderstructure may be slightly different on your system.

Do not use symlinks as tomcat won’t follow them.

You need to enable the block plugin when using the new gcn plugin. Please note that this feature might be enabled by default in future releases.


$CUSTOM_ALOHA_PLUGINS = array(
	'common/block'
);

$ALOHA_PLUGINS_GLOBAL = array_unique(array_merge($ALOHA_PLUGINS_GLOBAL, $CUSTOM_ALOHA_PLUGINS));