It’s easy to persist settings for an instance of DotNetNuke modules using ModuleController.GetModuleSettings(moduleId). But sometimes you want module settings to apply to all instances of a module within a given portal. I needed to do this for a module and used the following code:
PortalSettings portalSettings = (PortalSettings) HttpContext.Current.Items["PortalSettings"];ModuleController moduleController = new ModuleController();ModuleInfo moduleInfo = moduleController.GetModuleByDefinition(portalSettings.PortalId,"Site Settings");int globalModuleId = moduleInfo.ModuleID;Hashtable globalSettings = moduleController.GetModuleSettings(globalModuleId);
I suspect there may be better ways to achieve this objective, but this seems to get the job done. If anyone knows a better way please post in comments.
DotNetNuke
Remember Me
a@href@title, b, i, u
Contact me: nik*kalyani.com (replace "*")
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.