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

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Where do you define Settings fields?Where do you define Settings fields?
Previous
 
Next
New Post
2/13/2011 7:27 PM
 
When creating a module if you have data that you want to save associated with the Settings for the module, where do you define the fields and the data types for the fields?  From examples I can see how to retrieve these values and I can see where to update these values but I haven't been able to determine where to define them during the installation of the module.

Point me in the right direction.
 
New Post
2/13/2011 11:39 PM
 
You don't actually define them as such. The information is stored in a dynamic table inside the database.

What we usually do is in each module is declare a function called IsConfigured ()
We call this function at the top of the Page Load cycle.

We always then have a field in our module settings called InstanceConfigured.

We check if this setting has a value in it - if it doesn't we rewrite default values into all the settings for the module
including a value into InstanceConfigured - this initializes all the settings with workable values.

Westa
 
New Post
2/14/2011 12:25 AM
 
What table are the Setting values actually saved in?  I entered data into the Settings for my module but when I try to read the information back to display it I'm not getting any data. I was trying to find it in the database to verify that at least I had successfully written it to the database and I wasn't able to find it.  I tried the ModuleSettings but that doesn't look like it's got the right information in it.

Come out, Come out Where Ever you are.
 
New Post
2/14/2011 3:25 AM
 
Module setttings are either stored in table ModuleSettings (per instance) or TabModuleSettings (per page reference). HTH

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/14/2011 3:45 AM
 
This code should write to the settings for the current instance of this module:

Dim objModules As New DotNetNuke.Entities.Modules.ModuleController
 
Dim myString As String = txtShowOnce.Text
 
objModules.UpdateTabModuleSetting(TabModuleId, "ShowOnceContent", myString)


This code should read back from those same settings:

Dim objModules As DotNetNuke.Entities.Modules.ModuleController = New  _      DotNetNuke.Entities.Modules.ModuleController()
 
Dim MySettings As Hashtable = objModules.GetTabModuleSettings(TabModuleId)
 
Dim strContent As String = CType(MySettings("ShowOnceContent"), String)

Note this version uses tabmoduleid instead of moduleid - which imho is a lot safer unless you fully understand the implications of how moduleid v tabmoduleid can effect things if you copy a module.

Westa


Westa

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Where do you define Settings fields?Where do you define Settings fields?


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