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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesModule Instances and ModuleIDModule Instances and ModuleID
Previous
 
Next
New Post
8/20/2012 12:57 PM
 

I have developed a module that is to be used across several pages within my DNN portal.  It shows a list of webinars that one can register for or view depending on whether the webinar has already been recorded, or has not yet happened.  All of this functionality works quite well, but I have one issue.

In the settings control for this module, I allow the user to select an existing page within the portal.  This page is to be used as the "Detail" page for when a user clicks on the title of a webinar from the list.  I was originally using the Settings object, but after much reading, I modified the code to store the url for the detail page in the ModuleSettings object instead.  All other settings (for specific instances of the module) are being stored in the TabModuleSettings object.  My thought behind this is that I want all instances of the module across the entire portal to use the same detail page, but the other settings should be specific to an instance of the module.  For some reason, the detail page selected is not the same across all instances of the module in the portal.  Here is the assignment statement that is run when the settings are saved:

-----------------------

modules.UpdateModuleSetting(ModuleId, "WebinarDetailPage", PageDropDownList.SelectedItem.Value);

-----------------------

I was under the assumption that the ModuleSettings object would affect ALL instances of a module, and the TabModuleSettings object would only affect an instance of a module on a specific page.

I currently have two instances of this module on two separate pages.  I ran the following query on the DNN database to verify that everything was working correctly:

-----------------------

SELECT *
FROM dnn_ModuleSettings
WHERE SettingName = 'WebinarDetailPage'

-----------------------

This query returned TWO rows instead of one, and each instance of the module has its own unique ModuleID.

Shouldn't the ModuleId be the same across all instances of the module?  Is there something that I am missing here?

 
New Post
8/20/2012 5:57 PM
 
So when you place a Module on a page it gets a ModuleID and a TabModuleID.

If you add that same module to another page, it gets a new ModuleID and a new TabModuleID.

If you COPY the FIRST module to another page, it shares the ModuleID and gets a new TabModuleID on the new page.

ModuleSettings apply to all modules that have the same ModuleID, TabModuleSettings apply only to a specific module.

There are no settings in DNN (out of the box) that apply to every instance (unique or copied moduleids) of a specific type of module across a portal. One work around for this is to save a custom PortalSetting or HostSetting with the name of your Module/PortalID attached to it.

In the past I've used host settings like

ModuleSettingPortalId = Value

SomeSetting0 = "something"
SomeSetting1 = "something"

Where 0 and 1 are two separate portal ids.

Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
8/20/2012 6:20 PM
 

Chris,

First off, thanks for your quick response.  I ended up answering my own question earlier today when I ran across an article that mentioned exactly what you just explained.  My problem was that I was adding a new module each time I put it on a different page instead of copying an existing instance.

Most of the documentation and articles out there seem to suggest that as long as you use the ModuleSettings object it will apply to all instances of a module.  It seems a bit awkward that this strategy only works if you create the first instance and then copy it to other pages in order to create more.  Are there any plans in the future to implement a settings storage strategy that WOULD allow one to apply settings across all instances of a module regardless of how that module was added to portal pages?

Anyway, no use crying over spilled milk...my problem is solved, and again, I appreciate your quick reply.  On a side note, I thoroughly enjoyed your 25 part series on module development.  It was an excellent jumping off point for me when I first began working with DNN a few months back, and I look forward to seeing some more advanced topics in the future.

Cheers!

 
New Post
10/6/2012 8:46 AM
 

Hi,

First of all I want to thank you for very useful training tutorials and samples.

I am exploring DNN module development and for that I used your module TaskManager.

As you told that in most cases the module on every page have different ModuleId and task manager is adding task for those modules. So how can we remove task for that module when we are removing the module from any page.

DNN is not allowing me create relationship with "Modules" table.

Can you please suggest me, what should I do to fulfill my requirement.

Thanks in advance.

Regards,

Namrata Mathur

 

 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesModule Instances and ModuleIDModule Instances and ModuleID


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