Creating a Content tag
The Content tag directly renders a content item or site area.
About this task
The format of an Content tag:
[Content context=" " presentationPath=" " renderMode=" "]
Note: The content tag renders nothing in the case of an infinite
loop. For example if a presentation template uses the content tag
to render the current content, this will cause the same presentation
template to render, which in turn will render the content, and so
forth without end. Take care to avoid this occurring because it slows
down the time that is taken to render the tag.
To create an Content tag:
Procedure
Optional parameters
When you add the tag
to your design, you can also add the following parameters to the tag:
Tag parameters | Details |
---|---|
presentationPath="NamePath" | You can specify a specific presentation template to be used to render the content item or site area, in place of the default. |
renderMode="" | You can specify a render mode to use in place of the default mode. These render modes are predefined: summary, json, xml, html, default. You can use the Web Content Manager API to define further render modes.
You can create separate presentation templates for each type and select them when you create a site area template or content template: |
For example, setting a
content or site area with a specified UUID to render by specifying
the site area or content that is linked to by an element named MyLinkElement:
[Content uuid="[Element key='MyLinkElement' format='id']"]
You can render a content or site area from a predefined
context. This context can be portalContext, portletContext, portalMapping,
or autofill:
[Content context="portalContext"]
The content or site area to render can be specified by
using the name path. For example, to render /Web
Content/My Site Area/My Content:
[Content path="/Web Content/My Site Area/My Content"]
The content or site area to render can be specified relative
to the name path of the current context:
[Content path="./My Content"]