Creating an In Context tag | HCL Digital Experience
The InContext tag renders a tag body within a specified rendering context. The new rendering context can be specified as a predefined context by using a UUID, or by path.
About this task
The format of an InContext
tag:
[InContext context=" "] [/InContext]
To create an InContext
tag:
Procedure
Usage examples
Extra text, HTML, or tags
must be added between the [InContext]
and [/InContext]
tags. The text and tags added
here is what is rendered in the specified context.
For example,
setting a context with a specified UUID to render
MyElement
in
the context of the site area or content that is linked to by MyLinkElement
:[InContext uuid="[Element context='current' type='content' key='MyLinkElement' format='id']"] [Element context="current" type="auto" key="MyElement"] [/InContext]
You can render the tag body in a predefined
context. This context can be
portalContext
, portletContext
, portalMapping
,
or autofill
:[InContext context="portalContext"] [Element context="current" type="auto" key="MyElement"] [/InContext]
The new context can be specified by using
the name path. For example, to render MyElement in the context of /Web Content/My Site Area/My Content:
[InContext path="/Web Content/My Site Area/My Content"] [Element context="current" type="content" key="MyElement"] [/InContext]
The new context can be specified relative
to the name path of the current context:
[InContext path="./My Content"] [Element context="current" type="content" key="MyElement"] [/InContext]