Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 6 Current »

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.

Screenshot 2024-03-20 at 11.35.54.png

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

Screenshot 2024-03-20 at 10.44.58.png

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>

Screenshot 2024-03-20 at 10.58.43.png

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>

It is essential to ensure that the domain of the external site is included in the site's Content Security Policy (CSP), which is configured in the deployment manager. This helps maintain security by specifying which external resources are allowed to be loaded on 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.

Screenshot 2024-03-20 at 11.10.10.png

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.

Screenshot 2024-03-20 at 10.47.42.pnghtml-templates.mov

  • No labels