Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Adding a Field to an Element Component

The section topic Quick Start - 1 explains how to create a very basic element component using the element archetype. The archetype generates the following files (in the case of the HelloWorld example):

...

Because we want the word “Author” to be translated in the proper language in the Workspace as well as the website environment, we must define a language label for it. The element archetype generated two language files, one for US English (messages_en_US.properties) and one for Dutch (messages_nl_NL.properties) (additional language files can also be added). When creating language files, be sure that they conform to the development guidelines (G026, G027 and G028 in particular).

To each of these language files the author label must be added. The ID of the label is suffixed by an ‘=’ and followed by the translated value in the language to be added. The following code snippet needs to be added to the messages_en_US.properties and must be repeated for each supported language:

...

Because "Author" must be editable by users logged in to the XperienCentral Workspace, we must add the field to the JSP that renders the element (editCustomElement.jspf). Standard tags for property editing are supported by the wmedit tag library. The wmedit tag library generates the HTML for editing a property of a particular type. The property type that the tag should generate the HTML for is provided after the “:” separator. For a regular text input field the edit tag is input. To create an input field for editing the author, add this to the JSP:

...

Adding a Field to a Panel Component

In Quick Start - 1 it is explained how to create a very basic panel component using the panel archetype. This panel consists of only one tab, the "HelloWorld" tab. The archetype generates the following files in case of the HelloWorld example:

...

When adding language labels, be sure that they conform to the development guidelines (G027 and G028 in particular).

The following snippet should be added to the customTab.jspf (see Adding a field to the edit JSP for a complete description of adding a field to the edit JSP):

...

Adding a field to a Media Item component

In Quick Start - 1 it is explained how to create a very basic media item component using the media item archetype. The archetype generates the following files in case of the HelloWorld example:

...

When adding language labels, be sure that they conform to the WCB Development Guidelines (G027 and G028 in particular).

 

Adding a Field to the Edit JSP

...