Interface IPortalTemplateController
Work with Portal Templates.
Namespace: DotNetNuke.Abstractions.Portals.Templates
Assembly: DotNetNuke.Abstractions.dll
Syntax
public interface IPortalTemplateController
Methods
| Improve this Doc View SourceApplyPortalTemplate(Int32, IPortalTemplateInfo, Int32, PortalTemplateModuleAction, Boolean)
Apply a portal template to an existing (can be newly created) portal.
Declaration
void ApplyPortalTemplate(int portalId, IPortalTemplateInfo template, int administratorId, PortalTemplateModuleAction mergeTabs, bool isNewPortal)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | PortalId of the portal. |
IPortalTemplateInfo | template | The template. |
System.Int32 | administratorId | UserId for the portal administrator. This is used to assign roles to this user. |
PortalTemplateModuleAction | mergeTabs | Flag to determine whether Module content is merged. |
System.Boolean | isNewPortal | Flag to determine whether the template is applied to an existing portal or a newly created one. |
Remarks
When creating a new portal in DNN (PortalController.CreatePortal) the entry in the DB is first created and the necessary folders on disk. After that this method is run to finish setting up the new potral. But one can also apply a template to an existing portal. How clashes are handled is determined by the mergeTabs argument. The roles and settings nodes will only be processed on the portal template file.
ExportPortalTemplate(Int32, String, String, Boolean, IEnumerable<String>, String, IEnumerable<Int32>, Boolean, Boolean, Boolean, Boolean, Boolean)
Export a portal into a portal template.
Declaration
(bool success, string message) ExportPortalTemplate(int portalId, string fileName, string description, bool isMultiLanguage, IEnumerable<string> locales, string localizationCulture, IEnumerable<int> exportTabIds, bool includeContent, bool includeFiles, bool includeModules, bool includeProfile, bool includeRoles)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | PortalId of the portal to be exported. |
System.String | fileName | The filename to use when writing the portal template to disk. Note it will be written to the host directory (Portals/_default). |
System.String | description | Description of the template. |
System.Boolean | isMultiLanguage | Whether the template is a multi language template. |
IEnumerable<System.String> | locales | A list of locales that are to be exported. |
System.String | localizationCulture | The default locale. |
IEnumerable<System.Int32> | exportTabIds | A list of tab ids to export. These should be checked beforehand to ensure they form a continuous chain (i.e. no orphaned children or the resulting template can't be used). |
System.Boolean | includeContent | Whether to include module content. |
System.Boolean | includeFiles | Whether to include files found in the portal folder. |
System.Boolean | includeModules | Whether to include modules. |
System.Boolean | includeProfile | Whether to include user profile settings. |
System.Boolean | includeRoles | Whether to include the portal's roles. |
Returns
Type | Description |
---|---|
System.ValueTuple<System.Boolean, System.String> | A boolean indicating success and a string with an (success or error) message. |
GetPortalTemplate(String, String)
Load info for a portal template.
Declaration
IPortalTemplateInfo GetPortalTemplate(string templatePath, string cultureCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | templatePath | Full path to the portal template. |
System.String | cultureCode | the culture code if any for the localization of the portal template. |
Returns
Type | Description |
---|---|
IPortalTemplateInfo | A portal template. |
GetPortalTemplates()
Get all the available portal templates grouped by culture.
Declaration
IList<IPortalTemplateInfo> GetPortalTemplates()
Returns
Type | Description |
---|---|
IList<IPortalTemplateInfo> | List of PortalTemplateInfo objects. |