Skip to main content
Version: 1.28 (Current)

Load HTML Module

Audience: Low-code Engineers

Skill 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.

note

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.
Action NameDescription
Update HTML ModuleChanges the content of an HTML module.
Load ModuleLoads the properties of a module.
Export Module ContentExports a module's definition and content as XML.
Add ModuleAdds a new module to a page.
Load PageLoads the properties of a page.
Sanitize HtmlRemoves unsafe markup from HTML.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
PageThe 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.Yesempty stringNo
Module IdentifierThe 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.Yesempty stringYes
Regular ExpressionsA regular expression that extracts part of the content. The first match is saved. Leave it empty to save the whole content.Yesempty stringNo
Store content inThe name of the token that receives the content, for example Disclaimer. Square brackets are optional.Noempty stringYes

Output Parameters Reference​

ParameterDescription
Store content inThe 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 &lt;. 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​

tip

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