Web Content Viewers | HCL Digital Experience
Web Content Viewers are portlets that render content from a web content library as part of a portal page. If your presentation is simple, a single viewer can be sufficient. To provide a richer experience for your users, use multiple viewers to aggregate content from different libraries.
How viewers locate content
- The portlet configuration settings for the viewer can identify the default content to be rendered when a user browses to a page that contains the viewer.
- If the viewer does not specify default content, it determines whether a default content association is defined for the page. If a content association exists, the viewer renders the default content of the referenced site area in HCL Web Content Manager.
- If the current request contains a public render parameter (path-info or context), the viewer renders the content that is identified by the render parameter. This setting overrides the content setting from the portlet configuration or from the content association on the page. An example of a case where a render parameter might be involved is when users click a link to a content item.
Content reference in portlet configuration? | Content association on web content page? | Content that is rendered by viewer |
---|---|---|
Yes | No | Content that is identified by portlet configuration of the viewer. |
No | Yes | Content that is identified by association on page. |
Yes | Yes | Content that is identified by portlet configuration
of the viewer. The content that is specified in the portlet configuration can use a relative path. In this case, the complete path to the target content is derived by combining the associations on the page and the viewer. |
- Direct path to the target content
- A Web Content Viewer can reference either a site area or a specific
item in the library. This example is a reference to the item
Article
in the site areaArticles
of the libraryWeb Content
:
When you configure the viewer with a direct path to content, the content association on the page that contains the viewer is ignored.Web Content/Articles/Article
To configure a direct path to content, use the Select content and path setting in the Content behavior settings of the Web Content Viewer.
- Relative path to the target content
- When a content path based on a relative path is derived, the viewer
appends the content path in its configuration to the content association
on the page. For example:
- Content association on web content page:
Web Content/Articles
- Content that is referenced in portlet configuration:
Article
- Resolved content path:
Web Content/Articles/Article
To configure a relative path to content, use the Select content and use the content association of current page setting in the Content behavior settings of the Web Content Viewer.
- Content association on web content page:
- Reference no content
- You can define a content association on a web content page and then add a generic viewer that references no content. The viewer detects the site area that is defined by the content association on the page and renders content from the site area. No additional configuration of the Web Content Viewer is required.
- Reference specific content
- You can configure a viewer to point to a specific piece of content. You can then add this viewer to any web content page to render the mapped content, regardless of any content association on the page.
- Reference content with a relative path
- If you are using a consistent site structure with your web content libraries, you can take advantage of the relative path capability for referencing content. For example, you can create a reusable viewer that can render different content depending on the web content page where the viewer is deployed. By defining a viewer with a content association that uses a relative path, you can add instances of that viewer to different pages. The viewers then render different content, according to the content associations on the pages.
Create content with Web Content Viewers
- You can create content items quickly and easily, within the scope of the page where they are used.
- You can modify the individual copies of the content independently of each other.
- Typically, there is no need to further adjust the configuration of the viewer after you add it to the page.
Copied content is stored in the site area that is identified by the default content association of the current page. In addition, the portlet configuration of the newly added viewer is automatically updated to specify a relative path to the copied content.
Link Web Content Viewers
Many Web Content Viewers can be added to a single portal page or a series of pages. Sometimes it is necessary for different Web Content Viewers to interact with each other. For example, a menu component might be placed in one viewer and a content item in another viewer. If you want the content item to change when a different link is clicked in the menu, you must link the two viewers.
- Broadcasting links
- The state or context of a Web Content Viewer is not sent directly from one portlet to another. You can configure viewers to broadcast their current state or context to other viewers on the same page or to viewers on other pages. Any information broadcast by a Web Content Viewer is received only by viewers that are configured to receive this information.
- Receiving links
- A Web Content Viewer can receive the following information:
- Information about the state or context of the current content item or component that is being rendered by the viewer.
- Information from content items or components that are rendered by other viewers that are broadcasting links.
For examples of the different ways that you can use linking with Web Content Viewers, see Link examples for Web Content Viewers.
Web Content Viewers and remote servers
To display web content on a portal that does not include Web Content Manager, you can use the Web Content Viewer and the WSRP support in the portal. The Web Content Viewer can then retrieve and display content from a web content system on a different server.