MM 6.1 HTML templates
HTML templates allow custom and external content to be shown on the asset page.
To enable this feature, add the feature flag ‘html-templates’ in the Deployment Manager.
HTML templates are configured in Settings > Portal Config Manager - either for a specific portal or all portals (Global).
Create a new template
Template name
This name is used as Tab label in the asset page
Template language
Choose to display a template for a specific user language or create templates that are language-independent
Add content
The template may consist of valid HTML and styles, such as text wrapping within <p>
, <h2>
, <a>
, and other tags.
Ensure your HTML is valid and safe
Styling
The template is considered a standalone document within the site and does not inherit any styling from the surrounding context. Therefore, any required styling must be directly applied within the template itself.
Links
Include target='_blank' attribute within the anchor tag when adding links, otherwise the link will not function as intended. For instance: <a href='https://<url>' target='_blank'>Link text</a>
External content
You can integrate external content into your page using the <iframe>
tag. Simply specify the URL of the external content in the src
attribute. However, keep in mind that the external site must be configured to allow being embedded as an iframe.<iframe src="https://example.com" width="600" height="400"></iframe>
Ensure that the domain of the external site is included in your site's Content Security Policy (CSP), which is configurable via the deployment manager. The change is required to allow the external content to be loaded in your site.
The template may include a metadata field value, allowing for the dynamic passing of parameters to the external site, such as querystring parameters.
An example is provided below for reference.
Limit visibility of template
When selecting a metadata field, the template will only be displayed for assets that have a value in the specified metadata field.
Similarly, when specifying an asset type, the template will only be shown for assets of the chosen type.
View template on asset page
On the asset page, templates applicable to the page are added to the tab section, as highlighted in yellow in the example.