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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Custom Portal SettingsCustom Portal Settings
New Post
8/9/2010 5:17 PM

I am developing a suite of modules that need to have several settings that are Portal-level settings and not Module-level Settings.

Because of this I have a need to extend the base PortalSettings which does not appear to be possible without modifying the core. However, I discovered a new feature for creating custom portalsettings and table called dnn_PortalSettings (vertical table) for storing these settings.

In DNN 5.4.4, the class DotNetNuke.Entities.Portals.PortalSettings provides two shared methods:

Public Shared Function GetSiteSetting(ByVal PortalId As Integer, ByVal SettingName As String) As String

Public Shared Sub UpdateSiteSetting(ByVal PortalId As Integer, ByVal SettingName As String, ByVal SettingValue As String)


I have the following questions:

1) Am I correct in assuming that the purpose of these functions is to provide as mechanism to add additional custom portalsettings?

2) Will these custom portal settings be exported/imported as part of the create/clone portal from portal template wizard feature?

3) Are these custom portalsettings part of the cached portalsettings object?  Meaning, if I create my own custom portalsettings class definition that inherits from the base portalsetting class (with a fill method) and my module makes a reference to one of these custom settings, will the data be retrieved from the cached portalsettings object or will it be making a separate database call for each and every custom portal settings property accessed?

I could not find any posts on how to use this feature or accomplish what I need to do, so any advise would be very helpful and greatly appreciated.

Thanks Les.

New Post
8/9/2010 8:49 PM
1. the portalsettings class (similar to hostsettings and modulesettings) is an extensible storage mechanism for storing name value pairs. Whilst they're predominantly used by the core, they can be used by 3rd party developers (in fact modulesettings is commonly used in this way), and using the API is the correct mechanism (note: please use approriate names to avoid potential collisions with future settings - i recommend prepending names e.g. "les_custom")

2. all of the settings class's are serializable (they all inherit from baseentityinfo AFAIR) so do get exported with templates

3. all of them are read back as a cached dictionary object and cached accordingly i.e. the portalsettings class has can populate individual portalsettings (via the GetPortalSetting/GetPortalSettingAsBoolean/GetPortalSettingAsInteger properties), or the full set can be read back by calling GetPortalSettingsDictionary which loads all the portalsettings for the dictionary and uses callbacks to cache them and invalidate the cache upon a change.

Note: we're working on adding xml documentation to the public API so that you can use an API document (and soon an online API version) to determine how these methods (and others) can be used.


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
New Post
9/12/2010 8:28 AM
Hi, I am also trying to do something similar could not find find any posts. It would be great if either of you could upload a sample code snippet to hav a better idea as to how to go about accomplishing it. Cheers, Devang.
New Post
9/12/2010 11:41 AM
check out source code of dnn website, if you open your website in VS and search for the methods mentioned by Cathal before, you should be able to get a couple of samples.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
New Post
9/13/2010 7:53 PM
thnx guys, got tht to work ... fairly simple i would say :)
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Custom Portal SettingsCustom Portal Settings

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