Load HTML Module
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens
Reads the content of a DNN HTML module and saves it in a token. You can read the whole content, or use a regular expression to extract only part of it.
The action reads the published version of the module's content.
This action is part of the Portal Management add-on. The add-on is installed and licensed separately (feature package PORTAL). If the feature package isn't licensed, the action fails with a not-licensed error.
Typical Use Cases
- Reuse text that editors maintain in an HTML module, for example a disclaimer, in an email or a document
- Read the current content before changing it with Update HTML Module
- Extract one value from an HTML module with a regular expression
Don't use it to
- Read the properties or settings of a module. Use Load Module instead.
- Copy a module with its settings and content. Use Export Module Content instead.
- Read content from modules that aren't DNN HTML modules.
Related Actions
| Action Name | Description |
|---|---|
| Update HTML Module | Changes the content of an HTML module. |
| Load Module | Loads the properties of a module. |
| Export Module Content | Exports a module's definition and content as XML. |
| Add Module | Adds a new module to a page. |
| Load Page | Loads the properties of a page. |
| Sanitize Html | Removes unsafe markup from HTML. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Page | The page that contains the module. Pick a page from the list, or enter a Tab Id, a tab path (for example //RootPage//SubPage), or a page name. When you use a name, the first page with that name is used. Leave it empty to use the current page. | Yes | empty string | No |
| Module Identifier | The module to read. Enter a Module Id or a module title (not case-sensitive). The module must be on the page from Page. If more than one module has the title, the first one is used. | Yes | empty string | Yes |
| Regular Expressions | A regular expression that extracts part of the content. The first match is saved. Leave it empty to save the whole content. | Yes | empty string | No |
| Store content in | The name of the token that receives the content, for example Disclaimer. Square brackets are optional. | No | empty string | Yes |
Output Parameters Reference
| Parameter | Description |
|---|---|
| Store content in | The token named in this parameter holds the module's content as HTML, for example [Disclaimer]. If a regular expression is set, it holds the first match, or an empty value when nothing matches. |
Considerations
- The action fails silently. If the page or the module isn't found, or the module is empty, nothing is saved and the token keeps its previous value. Set the token to a default value first if later actions depend on it.
- Page is required outside a page. In workflows and API calls there's no current page, so leaving Page empty fails with
Could not get current page. - Only published content is read. Drafts that are waiting for approval in a content workflow aren't returned.
- The regular expression runs on the stored content. DNN stores HTML module content HTML-encoded, so
<is stored as<. The match is decoded before it's saved in the token. Test your expression against the stored text, and keep it simple. - The token contains raw HTML. If you display it somewhere else, remember that it can contain any markup editors added to the module.
- Use a Module Id when you can. Module titles aren't unique, and a title can change.
Examples
To understand how to use the below examples, please see Running Examples.
1. Load a disclaimer into a token
This action reads the HTML module titled Disclaimer on the Legal page and saves its content in the [DisclaimerHtml] token.
{
"Title": "Load HTML Module",
"ActionType": "LoadHtmlModule",
"Description": "Load the disclaimer text",
"Parameters": {
"PageId": "//Legal",
"ModuleId": "Disclaimer",
"RegexExpr": "",
"StoreLocation": "DisclaimerHtml"
}
}
2. Load a module by id from the current page
This action reads the HTML module whose Module Id is in the ContentModuleId token, on the current page, and saves its content in [CurrentContent].
{
"Title": "Load HTML Module",
"ActionType": "LoadHtmlModule",
"Description": "Load content from the current page",
"Condition": "[ContentModuleId] != \"\"",
"Parameters": {
"PageId": "",
"ModuleId": "[ContentModuleId]",
"RegexExpr": "",
"StoreLocation": "CurrentContent"
}
}
Revised 09/27/2026