31 Configure the Element
The Element form (CS Element) is used to create the CSElement's element, define the element file type (XML, JSP, or HTML), provide the element logic, and name the element. For example:
-
The Create Element field offers a choice of XML, JSP, or HTML file types for the element logic, and is used to seed the Element Logic field with standard stub code (which you have to include in any element that you create).
-
When you use the Create Element field to create, for example, a .jsp file, WebCenter Sites adds JSP
taglib
statements and therender.logdep
tag to the Element Logic field by default so that the compositional dependency between this CSElement asset and pages that are rendered from this element is logged. For other file types, WebCenter Sites adds code specific to the file type. You will add your own code to the Element Logic field.For information about dependencies, see About Dependencies. For help with coding the element logic, see Coding Elements for Templates and CSElements.
-
The Element Storage Path/Filename field names the file that holds the element logic and specifies the path to the file.
When the CSElement is saved, field values in the Element screen are written to a row (representing the element) in the ElementCatalog
table.
Note:
About Selecting an Existing Element
In the steps that follow, we assume you are creating a new element for the CSElement asset. If, however, you are migrating assets from an earlier WebCenter Sites release and want to reuse an existing element, you have to identify the element correctly so that WebCenter Sites can find it and associate it with the CSElement asset.
To select an existing element
-
(Optional). In the ElementCatalog Description field, type a description of the element.
-
In the Element Storage Path/Filename field, enter a value according to the convention in Naming the CSElement.
-
If your site design requires it, enter the appropriate arguments in the element parameter fields. For instructions, see step Link text cannot be resolved.
-
Save and re-open the CSElement asset.
WebCenter Sites checks for the presence of an element with the correct name:
If the element has been correctly named, WebCenter Sites recognizes the element and displays its code in the Element Logic field.
If the named element does not exist (or is incorrectly named), WebCenter Sites does nothing. When you inspect or edit the CSElement asset, WebCenter Sites displays a message stating that there is no root element in the form. As soon as you code the element and give it the correct name, WebCenter Sites detects it and associates it with the CSElement asset.
To configure a new element, enter the fields in the CSElement Element Form.