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.0Portal Wide SettingPortal Wide Setting
Previous
 
Next
New Post
10/25/2007 11:16 AM
 

Hi,

I've been building a couple of custom modules for DNN and I've made one module with a module setting called "Job Prefix".  I'm now creating a second module and i need access to the setting but i realise this wont be possible as i can have several instances of the module and i wont know which one to try and access, therefore i need to move this to a Portal wide setting.

What is the best way to create a Portal Wide Settings? 

  • Can this be done in the database, and if so, can i make this editable via the modules settings?
  • Can it be specified in the web.config file?
  • Can it be specified in a web.config file which is within the module directory?  Can this be done?

Many Thanks.

 
New Post
10/26/2007 5:21 PM
 

I personally use a specific database table for my module and store this value there, keyed by portal id that way my modules can all query from that table to get the value.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
10/27/2007 12:17 AM
 

In 4.5.x and 4.6.x versions (and perhaps even earler) there are (in the DotNetNuke.Entities.Portals.PortalSettings class) shared/static methods to both set and update portal wide settings (stored in the ModuleSettings table keyed on the ModuleID of the SiteSettings module):

Public Shared Function GetSiteSetting (PortalId as Integer, SettingName as String) As String
Public Shared Sub UpdateSiteSetting(PortalId as Integer, SettingName As String, SettingValue As String)

While this can be helpful for truly portal wide settings, I am concerned that as developers begin using this capability we will begin to see some horrible key colisions so if you go this route, be sure to prefix the SettingName with a unique identifier such as "WESNet_" or "WESNet_Families".

Some time ago (around DNN ver 3.1) I had proposed in these forums the need for more global module settings keyed by DesktopModuleId and PortalId and have included in a custom base class  (which inherits PortalModuleBase)  for any modules I develop the methods for getting and updating such settings from a table WESNet_DesktopModuleSettings which I initially create (along with the related stored proceedures)  as part of the install of a "dummy" module that includes some other controls, sprocs, HttpHandler, etc. common to several of my modules. By keying the setting on the DesktopModuleId as well as PortalId, the same setting name can be used without conflict in other unrelated modules.

In a complex module or several related modules with many settings, I've also used Mitch's suggestion of creating a database table keyed by PortalId and one column for each setting. This gives the advantage of strongly typed data as opposed to all values being stored as characters or text and makes sql joins on one or more settings far easier. The disadvantage is having to code the info class/controller/dataprovider/sprocs for the custom table and then remembering to modify the code each time a setting column is added.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Portal Wide SettingPortal Wide Setting


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