Portal Management
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens
The Portal Management add-on lets you build and change the DNN structure of your site from an action list. Its actions create, read, change and delete portals, pages and modules, read and write the content of HTML modules, and export and import pages and modules as XML. Use them to set up a page or a site for each new customer, project or event, and to clean it up later.
This add-on is the DnnSharp.PortalManagement package. It's installed separately and needs the PORTAL feature package in your license. If it isn't licensed, the actions fail with a not-licensed error. If you don't see these actions, the add-on isn't installed.
Choosing an action
| Action | What it does | Use it to |
|---|---|---|
| Create Portal | Creates a new parent portal from the Blank Website template and returns its portal ID. | Set up a new site for a customer or department. |
| Load Portal | Reads a portal's name, administrator, language, email and dates into tokens. | Check that a portal exists, or get its administrator or email. |
| Update Portal | Changes a portal's name, administrator, keywords, description or email. | Rename a portal or hand it to a new administrator. |
| Delete Portal | Deletes a portal with its pages, modules and files. It can't be undone. | Remove a customer's site when their subscription ends. |
| Create Page | Creates a page in the current portal from a page template and returns its ID and URL. | Create a page for each new customer, project or event. |
| Load Page | Reads a page's name, title, parent, dates, URL, permissions and custom settings into tokens. | Prefill an edit form, or check who can view a page. |
| Update Page | Renames, moves or hides a page, and changes its dates, permissions and custom settings. | Rename a page with its record, or move it under another parent. |
| Delete Page (Soft) | Sends a page and its child pages to the Recycle Bin. | Remove a page you might want back. |
| Delete Page (Hard) | Deletes a page, its child pages and their modules permanently. | Remove pages for good when their records are deleted. |
| Add Module | Adds a new, empty module of any type to a page and returns its module ID. | Add an HTML module to a page you just created. |
| Add Existing Module | Places a module that's on one page on another page, as a shared instance or an independent copy. | Show the same module on several pages, or copy a module from a template page. |
| Load Module | Reads a module's title, display options, dates and permissions into tokens. | Check that a module exists, or prefill a form before Update Module. |
| Update Module | Changes a module's title, display options, dates and permissions. | Show a module only during a campaign, or change who can edit it. |
| Delete Module (Soft) | Sends a module instance on a page to the Recycle Bin. | Take down a module you might want back. |
| Delete Module (Hard) | Removes a module instance from a page permanently. | Clean up modules made for a temporary purpose. |
| Load HTML Module | Reads the published content of an HTML module, or one part of it, into a token. | Reuse text that editors keep in an HTML module, such as a disclaimer. |
| Update HTML Module | Replaces the content of an HTML module, or the parts that match a regular expression. | Change a banner from a form, or publish generated content on a schedule. |
| Export Page | Exports a page with its settings, permissions and modules as XML in a token. | Keep a copy of a page, or make a page template for Create Page. |
| Export Module Content | Exports a module's definition, settings and content as XML in a token. | Copy a configured module, or back it up before you change it. |
| Import Module Content | Overwrites an existing module with module XML. | Load a template module's XML into a new module. |
Finding portals, pages and modules
Most actions take an identifier, and an empty one often means "the current one":
- Portals are found by portal ID or GUID. An empty identifier means the current portal in Load Portal and Update Portal, but not in Delete Portal, where it fails.
- Pages are found by page (tab) ID, by page path such as
//Customers//Acme, or by page name, in that order. A number is always treated as an ID, and a name uses the first page that has it. An empty identifier means the current page, except in Export Page, where you use[Tab:TabId]. - Modules are found on a page by module ID or by title. A title uses the first module on the page with that title, and an empty identifier matches the first module that has no title.
- There's no current page in workflows and API calls. There, an empty page identifier fails with
Could not get current page, so pass a page.
Titles and names aren't unique, so save the IDs the create actions return and use those in later actions:
- Create Portal returns the portal ID.
- Create Page returns the page ID and URL.
- Add Module and Add Existing Module return the module ID.
Not every action reports a missing item. Load Page, Update Page, Delete Page (Soft), the Load, Update and Delete Module actions, and the two HTML module actions do nothing when they can't find it. Check a loaded token, or add a condition, before you rely on the result. Load, Update and Delete Portal, Export Page, Add Existing Module, Export Module Content and Import Module Content fail instead. Delete Page (Hard) doesn't check that the page exists, so confirm the ID with Load Page first.
Soft or hard delete
Pages and modules each have a soft and a hard delete. Portals only have a permanent delete.
| Soft delete | Hard delete | |
|---|---|---|
| Where it goes | The Recycle Bin | Nowhere. It can't be restored. |
| A page's child pages | Sent to the Recycle Bin too | Deleted too |
| A page's modules | Left as they are | Deleted with the page |
| A module shared on other pages | Only this page's instance is removed | Only this page's instance is removed. DNN deletes the module when no other page shows it. |
- Restoring isn't an action. Restore soft-deleted pages and modules from the Recycle Bin in DNN. The module actions can't find soft-deleted modules, so you can't empty the Recycle Bin with them.
- Keep a copy before a hard delete. Use Export Page or Export Module Content first if you might need the content.
- To hide instead of delete, use Update Page to hide a page from the menu, or Update Module to set an end date or view permissions.
Building pages from templates
There are several ways to reuse a page or module you've already set up:
- A whole page. Export Page the template page, save the XML as a
.page.templatefile with Save File, and point the Dynamic Template of Create Page at it. You can also use templates made with DNN's own Export Page feature. - One module, shared. Add Existing Module with Make A Copy off. Both pages show the same module, so editing it on one page changes both.
- One module, copied. Add Existing Module with Make A Copy on, or Add Module followed by Export Module Content and Import Module Content. Content is only copied for modules that support DNN's content export.
- An HTML module's text. Add Module with the
HTMLtype, then Update HTML Module.
Considerations
- Permissions aren't checked. The actions that create, change, import or delete don't check whether the current user may do it. Only put them on forms, workflows and APIs that trusted users can reach, and add a condition as a second guard. Keep the portal actions for host users (superusers).
- Keep Administrators in your permission lists. In Create Page and Update Page, a listed permission replaces every grant of that permission, including the one for the Administrators role.
- Empty values don't clear anything. Update Portal, Update Page and Update Module leave a setting unchanged when its parameter is empty, so you can't clear a value with them.
- Treat exported XML as private. Page and module exports can hold settings, content and role permissions. Don't show them to users, and don't import XML from untrusted sources.
- New portals need their own license. Forms, Listings, Search and Nav only work on a new portal that's licensed with the MultiPortal licensing add-on. See MultiPortal Licensing.
To manage users and roles, see the User Management actions. To send the user to a new page, see the Redirect actions.
Revised 10/02/2026