|
User assistance for content authors |
|---|
The editable element tag is used to make elements from content items and site areas editable when rendered by using a web content viewer portlet when the page is in edit mode.
The format of an editable element tag:
[EditableElement type=" " context=" " name=" " key=" " format=" " mode=" " callback=" " class=" " placeholder=" "] [/EditableElement]
To create an editable element tag:
| Tag parameters | Details |
|---|---|
| name=" " | You must specify the name of the item that is referenced if the context="selected". If you specify name="./itemName", the actual path is not resolved until the item is rendered. This method takes slightly longer to resolve than specifying the path to the item. |
| format=" " | If you specify format="div",
the editable region is rendered within a div tag. If no format is
specified, a div tag is used by default. If you specify format="span", the editable region is rendered within a span tag. |
| mode=" " | This parameter determines the inline editing
mode.
If a mode is not specified, then the default setting that is specified in the inplaceEdit.defaultModeForText or inplaceEdit.defaultModeForRichText property of the WCM WCMConfigService service is used. Note: The
default rich text editor is always used with the modes 'inplace' or
'embed' are used. When the 'dialog' mode is used, the rich text editor
that is selected in the authoring portlet settings, or in the content
template for content items, is used.
|
| callback=" " | This parameter is used to reference an i$ promise. The promise is resolved if the inline edit is completed, and rejected if the inline edit is cancelled. See the Javadoc for more information about i$ promises. For example:
|
| class=" " | This parameter is used to specify a CSS class
to the div or span tag that is specified by using the format parameter. Note: The
custom class that you specify here must include styles with the names
"saving", "editing" and "error." These names are required for displaying
the editable field in edit mode, when saving, and to display error
messages.
The default css class that is used for inplace editable fields is wcm-default-inplace-editable. This class can be overridden by adding the following setting in the WCM WCMConfigService service by using the WebSphere® Integrated Solutions Console: inplaceEdit.defaultClasses=class1 class2 As many classes as required are added to this setting, separated by spaces. Base your custom classes on the default style sheet that is located at AppServer_root\installedApps\nodename\wcm.ear\wcm-inplaceEdit.war\css\default-style.css. Note: Any
classes that are specified on the EditableElement or EditableProperty
tag takes precedence over this value.
If you need to use the default css class as well, add it to the list of classes. For example: inplaceEdit.defaultClasses=wcm-default-inplace-editable class1 class2 |
| placeholder=" " | The text entered here is displayed when there
is no initial value for the body of the editable element field. For example: placeholder="Enter title" It can also be used in combination with a text provider to render translated text. For example: placeholder="[Plugin:TextProvider provider="com.mycompany.mybundle" key="enter_title"]" These
special values are used to render text from existing sources:
|
Additional text, HTML, or tags must be added between the [EditableElement] and [/EditableElement] tags. The text and tags added here is what is rendered on the page. When the page is in edit mode, this region is editable. When first added to your design, a corresponding element tag is added by default.
[EditableElement type="content" context="current" key="body"] [Element type="content" context="current" key="body"] [/EditableElement]