GetCurrentPortalId
Description: Gets the ID of the currently active portal.
Signaturepublic static int GetCurrentPortalId()
DeletePortal
Description: Deletes a portal by its ID.
Signaturepublic static void DeletePortal(int portalId)
CreatePortal
Description: Creates a new portal with the specified name and alias. Returns the new portal ID.
Signaturepublic static int CreatePortal(string portalName, string strPortalAlias, int userId = -1, string description = "NewPortal", string cultureCode = "en-US", bool useEmailAsUserName = true)
Parameters
portalName(string)strPortalAlias(string)userId(int) — optional, defaults to -1description(string) — optional, defaults to "NewPortal"cultureCode(string) — optional, defaults to "en-US"useEmailAsUserName(bool) — optional, defaults to true
BuildPortal
Description: Builds a portal from a config file, associating it with the specified admin user.
Signaturepublic static void BuildPortal(int portalid, int portalAdminUserId, string buildconfigfile)
Parameters
portalid(int)portalAdminUserId(int)buildconfigfile(string)
BuildDefaultSystems
Description: Builds and registers the default Rocket systems for a portal.
Signaturepublic static void BuildDefaultSystems(int portalId)
Parameters
portalId(int)
ActivateSystem
Description: Activates a Rocket system on the specified portal.
Signaturepublic static void ActivateSystem(int portalId, SystemLimpet systemData, SimplisityInfo postInfo = null)
Parameters
portalId(int)systemData(SystemLimpet)postInfo(SimplisityInfo) — optional
GetPortals
Description: Returns a list of all portal IDs in the DNN installation.
Signaturepublic static List<int> GetPortals()
GetPortalId
Description: Gets the portal ID of the current portal context.
Signaturepublic static int GetPortalId()
GetPortalIdBySiteKey
Description: Looks up a portal ID by its site key.
Signaturepublic static int GetPortalIdBySiteKey(string siteKey)
Parameters
siteKey(string)
GetPortal
Description: Returns the DNN PortalInfo object for the specified portal ID.
Signaturepublic static PortalInfo GetPortal(int portalId)
Parameters
portalId(int)
GetPortalName
Description: Returns the display name of the specified portal.
Signaturepublic static String GetPortalName(int portalId)
Parameters
portalId(int)
Registration
Description: Sets the portal registration type. Values: NoRegistration = 0, PrivateRegistration = 1, PublicRegistration = 2, VerifiedRegistration = 3.
Signaturepublic static void Registration(int portalId, int regType)
Parameters
portalId(int)regType(int) — NoRegistration = 0, PrivateRegistration = 1, PublicRegistration = 2, VerifiedRegistration = 3
EnablePopups
Description: Enables or disables popup windows for the specified portal.
Signaturepublic static void EnablePopups(int portalId, bool value)
Parameters
portalId(int)value(bool)
SSLSetup
Description: Configures the SSL setting for the specified portal.
Signaturepublic static void SSLSetup(int portalId, int value)
Parameters
portalId(int)value(int)
PageHeadTextUpdate
Description: Replaces the page head text (custom HTML injected into the <head> tag) for the specified portal.
Signaturepublic static void PageHeadTextUpdate(int portalId, string value)
Parameters
portalId(int)value(string)
PageHeadTextAppend
Description: Appends text to the page head (custom HTML injected into the <head> tag) for the specified portal.
Signaturepublic static void PageHeadTextAppend(int portalId, string value)
Parameters
portalId(int)value(string)
UpdatePortalSetting
Description: Saves or updates a named portal setting value.
Signaturepublic static void UpdatePortalSetting(int portalId, string settingName, string settingValue)
Parameters
portalId(int)settingName(string)settingValue(string)
UseEmailAsUserName
Description: Configures whether the portal uses email addresses as usernames.
Signaturepublic static void UseEmailAsUserName(int portalId, bool value)
Parameters
portalId(int)value(bool)
GetPortalSettings (current portal)
Description: Returns the DNN PortalSettings for the current portal context.
Signaturepublic static PortalSettings GetPortalSettings()
GetPortalSettings (by portal ID)
Description: Returns the DNN PortalSettings for the specified portal ID.
Signaturepublic static PortalSettings GetPortalSettings(int portalId)
Parameters
portalId(int)
EditorTemplate
Description: Returns the configured editor template name for the current portal.
Signaturepublic static string EditorTemplate()
LoginTabId (by portal ID)
Description: Returns the tab (page) ID of the login page for the specified portal.
Signaturepublic static int LoginTabId(int portalId)
Parameters
portalId(int)
LoginTabId (current portal)
Description: Returns the tab (page) ID of the login page for the current portal.
Signaturepublic static int LoginTabId()
GetPortalByModuleID
Description: Returns the portal ID that hosts the specified module.
Signaturepublic static int GetPortalByModuleID(int moduleId)
Parameters
moduleId(int)
GetAllPortalIds
Description: Returns a list of all portal IDs across the entire DNN installation.
Signaturepublic static List<int> GetAllPortalIds()
GetAllPortalRecords
Description: Returns a list of SimplisityRecord objects representing all portals.
Signaturepublic static List<SimplisityRecord> GetAllPortalRecords()
CreatePortalFolder
Description: Creates a folder within the portal's file system using the DNN folder API.
Signaturepublic static void CreatePortalFolder(DotNetNuke.Entities.Portals.PortalSettings PortalSettings, string FolderName)
Parameters
PortalSettings(DotNetNuke.Entities.Portals.PortalSettings)FolderName(string)
SetUserRegistration
Description: Sets the user registration mode for the portal (numeric value).
Signaturepublic static void SetUserRegistration(int portalId, int value)
Parameters
portalId(int)value(int)
GetUserRegistration
Description: Returns the current user registration mode value for the portal.
Signaturepublic static int GetUserRegistration(int portalId)
Parameters
portalId(int)
GetCurrentPortalSettings
Description: Returns the DNN PortalSettings for the currently active portal context.
Signaturepublic static PortalSettings GetCurrentPortalSettings()
GetDomainFromUrl
Description: Extracts the domain name from a full URL string.
Signaturepublic static string GetDomainFromUrl(string url)
Parameters
url(string)
GetPortalAliasesWithCultureCode
Description: Returns a dictionary mapping portal aliases to their culture codes for the specified portal.
Signaturepublic static Dictionary<string, string> GetPortalAliasesWithCultureCode(int portalId)
Parameters
portalId(int)
GetPortalAliases
Description: Returns a list of all portal aliases (hostnames) for the specified portal.
Signaturepublic static List<string> GetPortalAliases(int portalId)
Parameters
portalId(int)
DefaultPortalAlias (by portal ID)
Description: Returns the default portal alias for the specified portal. Uses the current portal if portalId is -1.
Signaturepublic static string DefaultPortalAlias(int portalId = -1)
Parameters
portalId(int) — optional, defaults to -1
DefaultPortalAlias (by portal ID and culture)
Description: Returns the default portal alias for the specified portal and culture code.
Signaturepublic static string DefaultPortalAlias(int portalId, string cultureCode)
Parameters
portalId(int)cultureCode(string)
AddPortalAlias
Description: Adds a new portal alias, optionally associated with a culture code.
Signaturepublic static void AddPortalAlias(int portalId, string portalAlias, string cultureCode = "")
Parameters
portalId(int)portalAlias(string)cultureCode(string) — optional
DeletePortalAlias
Description: Removes a portal alias from the specified portal.
Signaturepublic static void DeletePortalAlias(int portalId, string portalAlias)
Parameters
portalId(int)portalAlias(string)
SetPrimaryPortalAlias
Description: Sets or unsets the primary flag on a portal alias.
Signaturepublic static void SetPrimaryPortalAlias(int portalId, string portalAlias, bool isPrimary)
Parameters
portalId(int)portalAlias(string)isPrimary(bool)
SetSearchTabId
Description: Sets the tab (page) ID used as the search results page for the specified portal.
Signaturepublic static void SetSearchTabId(int portalId, int tabId)
Parameters
portalId(int)tabId(int)
SetDefaultLanguage
Description: Sets the default language (culture code) for the specified portal.
Signaturepublic static void SetDefaultLanguage(int portalId, string cultureCode)
Parameters
portalId(int)cultureCode(string)
GetDefaultLanguage
Description: Returns the default culture code (language) for the specified portal.
Signaturepublic static string GetDefaultLanguage(int portalId)
Parameters
portalId(int)
RootDomain
Description: Returns the root domain (hostname only) for the specified portal. Uses the current portal if portalId is -1.
Signaturepublic static string RootDomain(int portalId = -1)
Parameters
portalId(int) — optional, defaults to -1
DomainSubUrl
Description: Returns the sub-URL path component of the portal domain. Uses the current portal if portalId is -1.
Signaturepublic static string DomainSubUrl(int portalId = -1)
Parameters
portalId(int) — optional, defaults to -1
GetPortalAlias
Description: Returns the portal alias for the specified language/culture. Uses the current portal if portalid is -1.
Signaturepublic static string GetPortalAlias(string lang, int portalid = -1)
Parameters
lang(string)portalid(int) — optional, defaults to -1
GetPortalIdByAlias
Description: Looks up the portal ID for a given portal alias string.
Signaturepublic static int GetPortalIdByAlias(string portalAlias)
Parameters
portalAlias(string)
HomeDNNrocketDirectoryMapPath
Description: Returns the physical server path to the portal's DNNrocket home directory. Uses the current portal if portalId is -1.
Signaturepublic static string HomeDNNrocketDirectoryMapPath(int portalId = -1)
Parameters
portalId(int) — optional, defaults to -1
HomeDNNrocketDirectoryRel
Description: Returns the relative URL path to the portal's DNNrocket home directory. Uses the current portal if portalId is -1.
Signaturepublic static string HomeDNNrocketDirectoryRel(int portalId = -1)
Parameters
portalId(int) — optional, defaults to -1
DNNrocketThemesDirectoryMapPath
Description: Returns the physical server path to the portal's DNNrocket themes directory. Uses the current portal if portalId is -1.
Signaturepublic static string DNNrocketThemesDirectoryMapPath(int portalId = -1)
Parameters
portalId(int) — optional, defaults to -1
DNNrocketThemesDirectoryRel
Description: Returns the relative URL path to the portal's DNNrocket themes directory. Uses the current portal if portalId is -1.
Signaturepublic static string DNNrocketThemesDirectoryRel(int portalId = -1)
Parameters
portalId(int) — optional, defaults to -1
TempDirectoryMapPath
Description: Returns the physical server path to the portal's temp directory. Uses the current portal if portalId is -1.
Signaturepublic static string TempDirectoryMapPath(int portalId = -1)
Parameters
portalId(int) — optional, defaults to -1
BackUpDirectoryMapPath
Description: Returns the physical server path to the portal's backup directory. Uses the current portal if portalId is -1.
Signaturepublic static string BackUpDirectoryMapPath(int portalId = -1)
Parameters
portalId(int) — optional, defaults to -1
TempDirectoryRel
Description: Returns the relative URL path to the portal's temp directory. Uses the current portal if portalId is -1.
Signaturepublic static string TempDirectoryRel(int portalId = -1)
Parameters
portalId(int) — optional, defaults to -1
HomeDirectoryMapPath
Description: Returns the physical server path to the portal's home (Portals/{id}/) directory.
Signaturepublic static string HomeDirectoryMapPath(int portalId)
Parameters
portalId(int)
AddLanguage
Description: Adds a language (culture) to the specified portal.
Signaturepublic static void AddLanguage(int portalId, string cultureCode)
Parameters
portalId(int)cultureCode(string)
RemoveLanguage
Description: Removes a language (culture) from the specified portal.
Signaturepublic static void RemoveLanguage(int portalId, string cultureCode)
Parameters
portalId(int)cultureCode(string)
UpdatePortalCopyright
Description: Updates the copyright message (footer text) for the specified portal.
Signaturepublic static void UpdatePortalCopyright(int portalId, string copyrightMessage)
Parameters
portalId(int) — The portal IDcopyrightMessage(string) — The new copyright message
GetRootDomainUrl
Description: Returns the full root domain URL (including scheme) for the specified portal. Uses the current portal if portalId is -1.
Signaturepublic static string GetRootDomainUrl(int portalId = -1)
Parameters
portalId(int) — optional, defaults to -1
ClearPortalContent
Description: Clears all Rocket content data for the specified portal.
Signaturepublic static void ClearPortalContent(int portalId)
Parameters
portalId(int)
GetCurrentPageSkinCssPath
Description: Returns the relative URL path to the CSS file for the skin applied to the current page.
Signaturepublic static string GetCurrentPageSkinCssPath()
GetCurrentPortalCssPath
Description: Returns the relative URL path to the portal.css file for the current portal (/Portals/{portalId}/portal.css).
Signaturepublic static string GetCurrentPortalCssPath()
GetEffectiveSkinSrcForCurrentPage
Description: Returns the effective skin source path for the current page, resolving portal and page-level skin settings.
Signaturepublic static string GetEffectiveSkinSrcForCurrentPage()
GetPortalThemeSkinSrc
Description: Returns the skin source path configured as the portal-level default theme for the specified portal.
Signaturepublic static string GetPortalThemeSkinSrc(int portalId)
Parameters
portalId(int)
GetCurrentScheme
Description: Returns the current HTTP scheme (e.g. "http" or "https") for the active request.
Signaturepublic static string GetCurrentScheme()
GetCurrentBaseUrl
Description: Returns the base URL (scheme + domain) for the current request.
Signaturepublic static string GetCurrentBaseUrl()