Ektron
You can use an editor from another supplier with Ektron.
If you want to use a third-party editor, you will need to modify the following components:
ektron.cms.framework.ui.config
web.config
StyleConfig.js
[third-party]Ektron.aspx
C:\Program Files (x86)\Ektron\CMS400vxx\Utilities\EditorIntegrationUtility\EditorIntegrationUtility.exe
. IMPORTANT: If you are using Internet Explorer 9, you should set the following parameters to ensure optimum functionality.
1. Press F12 in your IE9 browser. A settings menu bar appears at the bottom of the browser above the tabs.
2. Set Browser Mode to Internet Explorer 9 (not Compatibility view).
3. Set the Documentation Mode to IE9 Standards.
4. Click X to exit.
web.config
To use a third-party editor in Ektron, edit web.config
and set ek_EditControlWin
(Windows) or ek_EditControlMac
(MacIntosh). If you download and install the third-party Aloha Editor, web.config
is modified for you by the EktronIntegrationUtility.exe
utility.
<!-- EditControlWin may be either "ContentDesigner" or "eWebEditPro" or "UserPreferred" or "Aloha" (if Aloha Editor is installed) --> <add key="ek_EditControlWin" value="Aloha" />
StyleConfig.js
You set up styles and classes that users can use with the Inspector plug-in in the StyleConfig.js
file. It is located at:
[siteroot]\Workarea\FrameworkUI\js\Ektron\Controls\EktronUI\Editor\
Aloha\plugins\ektron\inspector\lib\StyleConfigjs
In the following example, the Alert style is applied to the STRONG tag and is defined as follows.
"STRONG": { "styles": { "Alert": { "type": "style", "value": "color:red;", "workareaBox": "color:red;" } } }
STRONG
is the tag to which the Alert
style is being applied.Alert
is the name of the new style that displays in the Inspector's Style Selectortype
is defined as style
for an in-line style, or class
to be applied to an element.value
for this Alert style is red text that gets applied to the style or class element.workareaBox
attribute defines how the preview appears within the Inspector when the user chooses a style.To customize the tags and attributes that users can choose when editing with the Aloha Editor, modify the AlohaEktron.aspx
configuration file, which is located at:
[siteroot]/Workarea/FrameworkUI/js/Ektron/Controls/EktronUI/Editor/Aloha/
Edit the contentHandler
section to specify the elements, element attributes, and protocols that you can apply to content and for content clean up (such as saving or copying and pasting from an external editor source).
contentHandler: { insertHtml: [ 'word', 'generic', 'oembed', 'sanitize' ], initEditable: [ 'sanitize' ], sanitize: 'relaxed', allows: { elements: [ 'a', 'abbr', 'b', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'small', 'strike', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'u', 'ul', 'span', 'hr', 'object', 'div', 'script', 'figure', 'noscript', 'figcaption' ], attributes: { 'a': ['href', 'name', 'title', 'id', 'rel', 'rev', 'data-gentics-aloha-repository', 'data-gentics-aloha-object-id', 'data-ektron-url', 'style', 'class', 'onclick', 'onkeypress'], 'p': ['class', 'style'], 'span': ['class', 'style'], 'div': [ 'id', 'class'], 'abbr': ['title'], 'blockquote': ['cite'], 'br': ['class'], 'col': ['span', 'width'], 'colgroup': ['span', 'width'], 'img': ['align', 'alt', 'height', 'src', 'title', 'width', 'data-ektron-url', 'class', 'style'], 'ol': ['start', 'type'], 'q': ['cite'], 'script': ['type', 'language'], 'table': ['summary', 'width'], 'td': ['abbr', 'axis', 'colspan', 'rowspan', 'width'], 'th': ['abbr', 'axis', 'colspan', 'rowspan', 'scope', 'width'], 'ul': ['type'], 'li': ['class', 'style'], 'figure': ['data-media','data-media400', 'data-media600', 'title'] }, protocols: { 'a': {'href': ['ftp', 'http', 'https', 'mailto', '__relative__']}, 'blockquote': {'cite': ['http', 'https', '__relative__']}, 'img': {'src' : ['http', 'https', '__relative__']}, 'q': {'cite': ['http', 'https', '__relative__']} } } }, templatePlugin: {FolderID: 0}
In AlohaEktron.aspx
, templatePlugin: {FolderID: 0}
points to a folder in your CMS and defaults to 0 during installation. Modifying this value to a different folder ID changes the folder from which the templates are loaded. (This folder is where a user goes to select a template to insert.)
To create a new template, create and publish a piece of HTML content (that contains the content and formatting you want) in the folder you specify in AlohaEktron.aspx
.
When you insert a content template into HTML content that you are editing, you can modify the template. However, if you modify the template, the content created with the template will not be updated with those modifications. See Also: Using a Template to Structure Content
Ektron Plug-ins
NOTE: Plug-ins are open source, customizable pieces of JavaScript code. For more information about customizing the Editor and creating plug-ins, see Modifying Ektron Plug-ins and the webinar: Customize the Behavior of the Editor for Your Projects.
Ektron adds several useful plug-ins that let you use the Aloha Editor with Ektron. The administrator specifies plug-ins in the ektron.cms.framework.ui.config
file.
The editor plug-ins have the following prefixes:
common/
—plug-in native to the Alohaa browser-based, HTML5 WYSIWYG, third-party editor that you can use with Ektron. See http://aloha-editor.org. Editor.ektron/
—plug-in supplied by Ektron.extra/
—plug-in supplied by others. You can write your own plug-ins. (This document does not describe how.)common/abbr
()—lets you specify an abbreviation for content which shows up as bubble text.common/characterpicker
()—lets you insert special characters (such as ® and ±).common/contenthandler
—lets you paste HTML from another source.common/dom-to-xhtml
—ensures XHTML compliance. This plug-in enables Ektron controls.common/highlighteditables
—clicking on a content item highlights it for easy identification of content elements.common/link
()—lets you insert a hyperlink in the content.common/list
( and )—lets you create an unordered (bulleted <ul>
) or ordered (numbered <ol>
) list.common/paste
—uses the browser’s capabilities to paste content from the clipboard.common/undo
—uses the browser’s capabilities to undo the last action.ektron/contenthandler
—lets you paste content (Ctrl/v) from another source (such as Microsoft® Word) and preserves as much of the formatting as possible. NOTE: Some formatting may contain improper tagging, which is removed when it is pasted. Also, images will not paste into Ektron content; you must insert images that are loaded into the Ektron library.
ektron/editInContextCallback
—lets you raise callback events (that depend on your permissions and work flow) when you “edit in context.”ektron/format
—contains strong (), emphasis (), bold (), italic (), strikethrough (), subscript (), superscript (), and the formatting palette (paragraph, Heading1-Heading6, Pre, Span, Div, blockquote). ektron/template ()
—lets you insert a custom (developer-defined) snippet of code into your content at the cursor location; for example, a caption below an image. See Also: Using a Template to Structure Contentektron/horizonalrule ()
—lets you insert a horizontal rule.ektron/inspector()
—lets you view the properties of content, and assign properties to content tags and images. The inspector also lets you resize images.ektron/library
()—lets you insert an library item (file, form, hyperlink, image, and quicklinka special kind of hyperlink that jumps to another content item on your Web site. (A regular hyperlink jumps to a Web page on the internet.)) onto the editing page. ektron/sourceview
()—opens a view of HTML coding of the content. Whether you edit in the source viewer or the content block, both views are kept concurrent.ektron/table
()—lets you insert a table. If you select a table, you can insert additional rows or columns.NOTE: If you are in a last row and press <Tab> a new row will be added automatically.
ektron/translate
()—lets you machine-translate text into another Ektron-supported language. ektron/validator
()—lets you verify the current content against HTML5, MHTML, WC3, and WCAGWeb Content Accessibility Guidelines - making Web content accessible to people with disabilities. compliance.ektron.cms.framework.ui.config (where plug-ins are listed)
The following code example shows several default customizations. You can add or modify the templates and plug-ins that users can see and use for specific activities (such as edit-in-context). Only 1 template can be set as the default (true).
<add name="EditInContext"> <templates> <add name="Minimal" path="common/dom-to-xhtml,ektron/format,common/contenthandler, ektron/table,common/list,ektron/link,common/highlighteditables,common/undo, common/paste,common/characterpicker,common/horizontalruler,common/abbr, ektron/validator,ektron/inspector,ektron/template" default="true" /> <add name="Content" path="common/dom-to-xhtml,ektron/format,common/contenthandler, ektron/library,ektron/table,common/list,ektron/link,common/highlighteditables, common/undo,common/paste,common/characterpicker,common/horizontalruler, common/abbr,ektron/sourceview,ektron/translate,ektron/validator,ektron/inspector, ektron/template" default="false" /> <add name="Assets" path="common/dom-to-xhtml,ektron/format,common/contenthandler, ektron/table,common/list,ektron/link,common/highlighteditables,common/undo, common/paste,common/characterpicker,common/horizontalruler,common/abbr, ektron/translate,ektron/inspector,ektron/validator,ektron/sourceview" default="false" /> <add name="DiscussionTopic" path="common/dom-to-xhtml,ektron/format, common/contenthandler,ektron/library,ektron/table,common/list,ektron/link, common/highlighteditables,common/undo,common/paste,common/characterpicker, common/horizontalruler,common/abbr,ektron/translate,ektron/validator, ektron/inspector,ektron/template" default="false" /> <add name="Library" path="common/dom-to-xhtml,ektron/format,common/contenthandler, ektron/table,common/list,ektron/link,common/highlighteditables,common/undo, common/paste,common/characterpicker,common/horizontalruler,common/abbr, ektron/inspector,ektron/translate,ektron/validator,ektron/template" default="false" /> <add name="Mediamedia" path="common/dom-to-xhtml,ektron/format,common/contenthandler, ektron/table,common/list,ektron/link,common/highlighteditables,common/undo, common/paste,common/characterpicker,common/horizontalruler,common/abbr, ektron/translate,ektron/validator,ektron/inspector,ektron/template" default="false" /> <add name="NonLibraryContent" path="common/dom-to-xhtml,ektron/format, common/contenthandler,ektron/table,common/list,ektron/link, common/highlighteditables,common/undo,common/paste,common/characterpicker, common/horizontalruler,common/abbr,ektron/translate,ektron/inspector, ektron/validator,ektron/template" default="false" /> <add name="CalendarEntryCMSUser" path="common/dom-to-xhtml,ektron/format, common/contenthandler,ektron/library,ektron/table,common/list,ektron/link, common/highlighteditables,common/undo,common/paste,common/characterpicker, common/horizontalruler,common/abbr,ektron/validator,ektron/inspector, ektron/template,ektron/sourceview,ektron/translate" default="false" /> <add name="CalendarEntryMembershipUser" path="common/dom-to-xhtml,ektron/format, common/contenthandler,ektron/table,common/list,ektron/link, common/highlighteditables,common/undo,common/paste,common/characterpicker, common/horizontalruler,common/abbr,ektron/validator,ektron/template, ektron/sourceview,ektron/translate" default="false" /> <add name="EditInContext" path="common/dom-to-xhtml,ektron/format, common/contenthandler,ektron/table,common/list,ektron/link, common/highlighteditables,common/undo,common/paste,common/characterpicker, common/horizontalruler,common/abbr,ektron/inspector,ektron/sourceview, ektron/library,ektron/validator,ektron/editInContext" default="false" /> </templates> </add>
ektronUI:Editor Control
The ektronUI:Editor
control is an ASP.NET server component that you can integrate into your ASPX pages. The following example shows the control on an ASPX page. The EditInContext
value to the ToobarConfig
attribute specifies a group of plug-ins—from the ektron.cms.framework.ui.config
file—to be loaded with the Editor .
<!DOCTYPE html PUBLIC "~//WJC//DTD XHTML 1.0 Strict//EN" "http:..www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Editor control integration</title> </head> <body> <div id="content"> <ektronUI:Editor ID="Editor1" runat="server" ToolbarConfig="EditInContext" /> </div> </body> </html>
Ektron plug-ins are stored at \Workarea\FrameworkUI\js\Ektron\Controls\EktronUI\Editor\Aloha\plugins\ektron\[plug-in_name]
. Each [plug-in_name]
folder has a CSS
and lib
folder containing the following files:
Plug-in_Name.css
—Cascading style sheet for the plug-in.Plug-in_Name-plugin.js
—JavaScript file for the plug-in.Plug-in code has the following basic outline:
Init
function that executes upon loading (usually to create the button)createButtons
function that adds a button to floating menuThe following example shows how to insert a "Hello World" snippet within a <span>
tag.
// define the HelloWorld module using RequireJS define([ 'aloha', 'aloha/plugin', 'aloha/floatingmenu', 'aloha/jquery', 'i18n!aloha/nls/i18n', 'css!helloworld/css/helloworld.css'], // callback executed once dependencies are loaded by RequireJS function (Aloha, Plugin, FloatingMenu, jQuery, i18nCore) { // create and register the Plugin return Plugin.create("helloworld", { defaults: { text: "Hello World!", wrapper: '<span class="helloworld"></span>' }, init: function () { // executed on plugin initialization window.console.info("HelloWorld: Begin initialization"); this.createButtons(); window.console.info("HelloWorld: End initialization"); }, createButtons: function () { // provide locally scoped version of this for use // in callbacks,e tc. var that = this, tabInsert = i18nCore.t('floatingmenu.tab.insert'); // create hellowworld button this.helloWorldButton = new Aloha.ui.Button({ 'name': 'helloWorld', 'iconClass': 'ektron-aloha-button ektron-aloha-helloWorld', 'size': 'small', 'onclick': function () { that.insertHello(); }, 'tooltip': "Click to insert Hello World!", 'toggle': false }); // add it to the floating menu FloatingMenu.addButton( 'Aloha.continuoustext', this.helloWorldButton, tabInsert, 1 ); }, insertHello: function () { window.console.info("HelloWorld: Hello World Button clicked"); var html = jQuery(this.settings.wrapper).text(this.settings.text); // get the current selection range var range = Aloha.Selection.getRangeObject(); if (range.isCollapsed()) { GENTICS.Utils.Dom.insertIntoDOM(html, range, jQuery(Aloha.activeEditable.obj)); } else { // remove the contents of the current selection range.deleteContents(); // insert our Hello World elements GENTICS.Utils.Dom.insertIntoDOM(html, range, jQuery(Aloha.activeEditable.obj)); // deselect the current range object Aloha.getSelection().removeAllRanges(); } return false; } }); } );
For more information about creating and adding your own plug-ins, also see the Aloha website.
IMPORTANT: You must install the Aloha Editor to use these plug-ins. See Setting up the Aloha Editor for Use with Ektron.
Ektron has useful plug-ins to the third-party Alohaa browser-based, HTML5 WYSIWYG, third-party editor that you can use with Ektron. See http://aloha-editor.org. Editor to enhance its use with Ektron. You can download the third-party Aloha Editor from the Aloha website.
When your cursor hovers over editable content in Ektron, a yellow border appears and turns blue when you click in the content to edit; a floating editor toolbar appears near your editing cursor.
NOTE: You can place the editor toolbar anywhere on the screen and make it stay by clicking on the pin icon (). When pinned, the icon changes ().
The editor toolbar contains plug-in functions (represented by an icon or button) that the system administrator installs. The administrator can customize the editor toolbar so that some editing features are available depending on circumstance. For example, you may want the Inspector plug-in to be available from the Workarea but not while editing content in context on a Web page. For information about plug-ins, see Modifying Ektron Plug-ins.
Cut, copy, and paste are handled by your browser. Right-click to choose these functions. Pasted content may be modified by Aloha depending on the tags that the administrator sets in StyleConfig.js
. For example, headings, bullets, and bolded fonts may be maintained during a paste operation but the actual font may not. Paste HTML content into the Source Viewer.
Spell checking is handled by your browser. If your browser does not have spell checking, you can find and load a plug-in to do it.
IMPORTANT: When you copy and paste content from an application into the Aloha Editor, the editor attempts to properly format the content into valid and minimal HTML while retaining as much formatting and styling as possible. However, each browser affects this operation differently, so your results may differ depending on the browser you are using.
NOTE: The Text formatting style applies a <span>
tag to content you select. You then can select it in the Inspector for additional style modifications.
The Inspector and Source Viewer plug-ins let you view and edit HTML code and style information about your content by clicking the Open Viewer () tab (or by clicking View Source () on the Review tab of the editor bar). As you edit the HTML, the content window dynamically updates with your changes. Check the Widen Source View Panel box for more room to edit the HTML. The following example shows how the viewer works with the editor.
You can validate your content against Accessibility (Section 508Section 508 Of The Rehabilitation Act - requiring electronic and information technology to be accessible to people with disabilities. Guideline), HTML5, or XHTML guidelines, by clicking on Validate () on the Review tab. The Content Validator screen appears. Choose which guideline you want to use from the drop-down menu, then click Validate.
NOTE: Each standard may have conflicts with the other standards; valid HTML5 code may not be valid XHTML code. Choose the standard guideline that you need.
NOTE: When you select a link, you can modify the title and target in the Source Viewer.
When you hover over hypertext link text in the editor, an underline appears below the link. Click the cursor on the linked item. The Link tab appears in the editor toolbar showing you the URLUniversal Resource Locator or item to which the text is linked. You can Ctrl+click on a link to open a link in the specified target.
See Working with Images in the Ektron default editor. Working with images is almost the same with each editor. For example, setting a border, aligning an image, and adding space around an image are done through the inspector, and applying the appropriate style that was configured by your developer.
You can use <Tab> to move from one cell to the next. If you are on the last cell, <Tab> creates a new row.
You can apply styles, such as borders and padding, that are not part of your default table styling in the Source Viewer.
Click on the gray area beside a row or above a column and it highlights your selection. Click on the Table tab to insert columns, or delete your selection, or merge the cells.
If you click on a row, you can convert the row to be a table header, which lets you create 508Section 508 Of The Rehabilitation Act - requiring electronic and information technology to be accessible to people with disabilities.-complaint tables without having to modify the source code.
IMPORTANT: A table in the Workarea may appear differently from a table you edit in context. When you save and publish your content, your site styling is applied.
NOTE: To split a merged cell, select the column or row of the merged cell before clicking Split.
An editor template is HTML-formatted content that users can copy into content to help users maintain the structure that you want. For example, you may want images in content to have a caption on the left with content that flows around it, so you create the mark-up to do this and put it in a template.
To set up a template, the administrator creates a folder in the CMS to contain the templates and specifies the folder by its ID in the AlohaEktron.aspx file. (The default ID is 0.)
templatePlugin: {FolderID: 45}
NOTE: You can set permissions on this folder like any other, but restricting the ability to view the content also restricts the ability to insert the templates into their content.
After the folder is created, create an HTML template and store it in this folder. You can create the HTML directly or use the content view to create your template. When finished, click Publish and the template is ready to insert into content.
To insert a copy of the template, place the cursor where you want it and click Template () on the Insert tab. Select a template from the list and click Insert. The template content is copied into your content, which you can modify as you like; modifications will not affect the template. If you change the template, it will not change any of the modifications you made to previously-inserted copies of the template.
This section describes using machine translation to change content into another language. Machine translation operates on an entire piece of content, and not selected portions of content. For complete translation information, see Translating Content and Working with Multi-Language Content.