Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0storing portal host wide settings as a module developer?storing portal host wide settings as a module developer?
Previous
 
Next
New Post
5/29/2008 11:37 AM
 

As a module developer I can store ModuleSettings and TabModuleSettings. But suppose for some reason I need to store a certain setting for a Module that should be available to all other Modules in the Portal or Host...  Can I just add host/portal settings as module developer?

 
New Post
5/29/2008 12:41 PM
 

There are two ways to get this done.  First, you can use DotNetNuke.Entities.Portals.PortalSettings.UpdateSiteSetting and DotNetNuke.Entities.Portals.PortalSettings.GetSiteSetting to set settings.  This is actually just a shortcut to the module settings of the portal's Site Settings control.  Because of this, you need to very careful and explicit in your naming to make sure that you don't accidentally overwrite a core setting or another module's settings.

You can also use DotNetNuke.Entities.Host.HostSettings.GetHostSetting and DotNetNuke.Entities.Host.HostSettingsController().UpdateHostSetting to write your own settings at the host level, making sure to include the PortalID in the setting when you do that.  This has less chance of overwriting a core setting, but is otherwise basically the same deal as above.

Hope that helps,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
5/30/2008 12:51 AM
 

One thing that you do need to be careful of when using PortalSettings or HostSetting is that doing so  can break the ability to TEMPLATE snapshot a site 
taking advantage of module Import/Export.

The reason for this is that when you generate a site form a template the PortalSettings Module is not  always created before your own module.
As a result calls to updatesitesettings etc in your module import implementation fail at import during the template installation.

Westa

 
New Post
6/2/2008 2:45 AM
 

Thanks!

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0storing portal host wide settings as a module developer?storing portal host wide settings as a module developer?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out