Creating an element tag | HCL Digital Experience
The Element tag is used to reference an element within a presentation template or element design.
About this task
The format of an element tag:
[Element type=" " context=" " name=" " key=" " format=" " pre=" " link=" " separator=" " htmlencode=" " awareness=" " ifEmpty=" " start=" " end=" " ]
To create an element tag:
Procedure
- Click Insert a Tag from a presentation template or element design field. The Tag Helper dialog opens.
- Select Element as the tag type.
- Select the item type where the element is stored, and the
context that is used to determine which item to reference:
If not set, the item type is
content
and the context iscurrent
.Table 1. Context and item type matrixThis table describes how context changes for different item types. Context and Item Type type="auto"
type="content"
type="sitearea"
type="parent"
type="top"
context="Selected"
If selected, the context is set by the selected item. You select an item by clicking Select. This parameter is added to the tag as the
name=" "
parameter.This parameter displays an element from the selected item. This parameter displays an element from the selected content item. If a site area is selected, then nothing is displayed.
If the selected item is a site area, then this parameter displays the element from the site area. If the selected item is a content item, then this parameter displays the element from the parent site area of the content item.
This parameter displays an element from the parent of the selected item. This parameter displays an element from the first item in the path of the selected item. context="Current"
If selected, the context is set by the current item.
This parameter displays an element from the item currently being rendered. This parameter displays an element from the current content item. If a site area is selected, then nothing is displayed.
If the item currently being rendered is a site area, this parameter displays the element from the current site area. If the item currently being rendered is a content item, this parameter displays the element from the parent site area of the content item.
This parameter displays an element from the parent site area of the item currently being rendered. This parameter displays an element from the first item in the path of the item currently being rendered. context="Autofill"
Use this option when the element that is referenced is determined by the search parameters of a menu, navigator, or taxonomy component. If the tag is not used within a menu, navigator, or taxonomy component, the context reverts to the current item.
This parameter displays an element from the item that is returned by a menu, navigator, or taxonomy component. This parameter displays an element from a content item that is returned by a menu, navigator, or taxonomy component. If a site area is selected, then nothing is displayed.
If the current item returned by a menu, navigator, or taxonomy component is a site area, then the element from the site area is displayed. If the current item returned by a menu, navigator, or taxonomy component is a content item, then the element from the parent of the content item is displayed.
This parameter displays an element from the parent item of the item that is returned by a menu, navigator, or taxonomy component. This parameter displays an element from the first item in the path of the item that is returned by a menu, navigator, or taxonomy component. context="portalContext"
If selected, the context is set by the context of the current page. This option is only valid for content that is delivered by using a web content viewer portlet.
See the knowledge center topic that is called Web content associations for further information.
This parameter displays an element from the current page context item. If the context of the current page is a content item, the element from the current content item is displayed. If the context of the current page is a site area, the element from the default content item of the site area is displayed.
If the context of the current page is a site area, the element from the site area is displayed. If the context of the current page is a content item, the element from the parent of the content item is displayed.
This parameter displays an element from the parent of the current page context item. This parameter displays an element from the first item in the path of the current page context item. context="portalMapping"
If selected, the context is set by the web content association of the current page. This option is only valid for content that is delivered by using a web content viewer portlet.
See the knowledge center topic that is called Web content associations for further information.
This parameter displays an element from the item that is selected as the default web content association of the page. This parameter displays an element from the default content item of the site area that is selected as the default web content association of the page. This parameter displays an element from the site area that is selected as the default web content association of the page. This parameter displays an element from parent of the item that is selected as the default web content association of the page. This parameter displays an element from the first item in the path of the item that is selected as the default web content association of the page. context="portletContext"
If selected, the context is set by context of the current web content viewer portlet. This option is only valid for content that is delivered by using a web content viewer portlet.
This parameter displays an element from the current portlet context item. If the context of the current portlet is a content item, the element from the current content item is displayed. If the context of the current portlet is a site area, the element from the default content item of the site area is displayed.
If the context of the current portlet is a site area, the element from the site area is displayed. If the context of the current portlet is a content item, the element from the parent of the content item is displayed.
This parameter displays an element from the parent of the current portlet context item. This parameter displays an element from the first item in the path of the current portlet context item. Portal mapping versus portal context: The portal mapping context is determined by the web content associations that are assigned to each page. This context is used for rendering when users first access a page. The context of the page can change when users interact with the content on the page. Each web content viewer on a page can be configured with an explicit context that overrides the rendering page context. The context of the portlet can also change if it is configured to receive links. When users click a link within the viewer that is configured to broadcast its links, the page context is updated. This new context is maintained until users click another link, or until users start a new session. When users start a new session, the original page context is used. - Click Select authoring template to
select an appropriate authoring template. Select the element to display
from the list of available elements. This parameter is added to the
tag as the
key=" "
parameter: - Click OK to add the tag to your navigator design.
What to do next
Tag parameters | Details |
---|---|
name=" " |
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=" " |
This parameter is optional and can be used only
with some element types:
|
pre="
" |
Set pre="true" to
enable multi-line support. This setting is only applicable to the
text and short text elements. If enabled, line breaks entered by the
user when they enter text in these elements are recognized when rendered.
If not specified, this setting defaults to false. |
link=" " |
The link parameter is used to define the type
of link that is created by the element tag:
Contextual linking: Contextual
linking is used so that when content is linked from another site,
the link is rendered relative to the current site if possible. It
can be used only if |
separator=" " |
This parameter is used when you reference an
option selection or user selection element. It is used to define what
text or code is rendered between each selection that is displayed
in an option selection or user selection element. For example, to
add a line break between each selection, you would use separator="<br>" . If not defined, a comma
is placed between each selection when rendered. |
htmlencode=" " |
If htmlencode="true" ,
then the reserved HTML characters in elements that display text are
converted into character entities. For example, '< '
is converted to '< '. This method
is useful if you would like to prevent users from adding malicious
code, or if you want to prevent users from changing the design of
their text by using HTML. If not specified, the default setting specified by the cmpnt.htmlEncodeDefault property in the WCM WCMConfigService service is used for displaying text. The default setting specified by the cmpnt.htmlEncodeUrls property in the WCM WCMConfigService service is used for displaying URLs. By default, these properties are set to true. |
awareness=" " |
If awareness="true" then
user names are displayed by using the people awareness features. These
features display user names as hyperlinks that allow users to contact
people with whom they might want to work. Wherever person links appear,
users can click the link to display a menu of actions for collaborating
(contacting and working) with the person named by the link. If an
administrator has also configured an HCL Sametime server to work with HCL Portal, person links indicate
whether a person is active, away, offline, or in a Do Not Disturb
state. If not specified, then |
ifEmpty=" " |
Enter some text to display if no result is returned by the tag. If not specified, nothing is displayed if no result is returned by the tag. |
start=" "
|
The start and end attributes are used to wrap the data that is returned by a tag within other tags, such as HTML. These attributes are not mandatory. |