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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...ModuleID or TabModuleID?ModuleID or TabModuleID?
Previous
 
Next
New Post
7/10/2009 5:30 PM
 

What is the difference between moduleID and TabModuleID? I need to know for my database queries so I know what module I am getting data from. Should I be using TabModuleID instead of ModuleID? - Am totally confused.

 
New Post
7/10/2009 9:28 PM
Accepted Answer 

The basic differences are as follows:

Each module instance added to a portal with "Add New Module" will have a unique ModuleID. Module instances added to a portal with "Add Existing Module" will have unique TabModuleID's but share the SAME ModuleID. This distinction is important to note both in accessing a module's data (most often keyed or at least partially keyed by ModuleID) and when storing and retreiving a module's settings.

Module settings are stored in the DNN ModuleSettings table and are keyed by both ModuleID and SettingName. As you might guess, ModuleSettings are shared between instances of the same module. The method UpdateModuleSetting of the ModuleController class saves and updates ModuleSettings.

TabModule settings are stored in the DNN TabModuleSettings table and are keyed by both TabModuleID and SettingName. These settings are unique both to each instance of the same module. The method UpdateTabModuleSetting of the ModuleController class saves and updates TabModuleSettings.

A module's Settings collection returns both its ModuleSettings and TabModuleSettings in one hash table. If you create a ModuleSetting and a TabModuleSetting with the same SettingName, the TabModuleSetting will take priority when retrieved.


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
 
New Post
7/11/2009 4:25 AM
 

Though Bill is completely correct in his statements, I'd like to explain the basics a bit different for better understanding:

If you select a module definition from the dropdown list in control center and select "add to page", a new module instance is created (identified by moduleID) and a reference between the module instance and the page, called tabmodule, storing position and some display options. This separation allows to reuse the module instance on other pages by selecting "add existing module", which simply creates an additional tabmodule reference to the module instance with individual position and some individual display settings. Tabmodule settings are extensible by modules, e.g. UserDefinedTable (now form and List) allows filtering and different rendering per reference, reusing the same module instance).

When a module is deleted, the page reference is stored in the recycle bin and the module instance only, if there is no additional 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
10/17/2011 5:11 AM
 
Hi,is there a reference to all the instances of the module. i.e. i'm developing a realestate module which shoud be added to some pages as "add existing..." and on others with "add module", but on all of them I need to set the Euro exchange rate through module settings (set it once for all the instances). How should I do that through the framework ( as with ModuleSettings or TabModuleSettings I cant)?
 
New Post
12/24/2011 12:58 PM
 
1. ### in ModuleSettingsBase.cs
the ModuelSettings is priority over, overwrite to TabModuleSettings
public new Hashtable Settings
{
get
{
if (_settings == null)
{
_settings = new Hashtable();
//Merge the TabModuleSettings and ModuleSettings
foreach (string strKey in TabModuleSettings.Keys)
{
_settings[strKey] = TabModuleSettings[strKey];
}
foreach (string strKey in ModuleSettings.Keys)
{
_settings[strKey] = ModuleSettings[strKey];
}
}
return _settings;
}
}


2. ### in ModuleInstanctContext.cs
the TabModuelSettings is priority over, overwrite to ModuleSettings
public Hashtable Settings
{
get
{
var controller = new ModuleController();
if (_settings == null)
{
//we need to make sure we don't directly modify the ModuleSettings so create new HashTable DNN-8715
_settings = new Hashtable(controller.GetModuleSettings(ModuleId));

//add the TabModuleSettings to the ModuleSettings
Hashtable tabModuleSettings = controller.GetTabModuleSettings(TabModuleId);
foreach (string strKey in tabModuleSettings.Keys)
{
_settings[strKey] = tabModuleSettings[strKey];
}
}
return _settings;
}
}

Why that? i think alway priority for TabModuleSettings.? anybody know that, thanks

dnnupgrade.com - Upgrade your dnn from vietnam
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...ModuleID or TabModuleID?ModuleID or TabModuleID?


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