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

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsBlogBlogHelp me to understand module architectureHelp me to understand module architecture
Previous
 
Next
New Post
1/15/2009 6:24 AM
 

Hi,

I'm developing a module that when viewed on a page has two distinct parts to it - by parts I mean two logically distinct sets of server controls (e.g. labels, datagrids etc.). For the purpose of the following  explanation assume the two sets of controls are called Part A and Part B. Currently both parts A and B are on a single user control (i.e. .ascx) and I've arranged them so that they appear above one another (in rows in a table). I've been asked by a colleague whether it’s possible for the site administrator to at runtime (via module settings for example) to specify the visibility of each part and to specify how they should be arranged (e.g. above one another or side-by-side etc.). In order to achieve this I'd like to implement something akin to what happens when you add a Blog module to a page -i.e. more than one module gets added to the page and the administrator can rearrange the different modules in the various panes or indeed remove one part if its not required. I know in the short term I could in the case of visibility just set the visible property of the table row but I can see cases in the future where I need something akin to how the Blog module is structured.

I've downloaded the source code for the Blog module to get an idea of its architecture but I'm finding it a bit confusing. To date all my modules, whilst having different views have been of the single blob variety (i.e. the modules functionality is divided across several user controls, which get added to a parent MainView.ascx at runtime) but I can see cases where I need to structure things differently and I'm keen to learn more.

I'd be grateful if someone could explain briefly how the Blog module is structured and how it hangs together (- particularly how several modules get added when you add an instance of the Blog module to a page), or if they could point me to resource that explains how to develop similar multipart modules. I note from looking at the Host->Module Definitions page that the Blog module has multiple module definitions and multiple edit and view controls. How does this all tie in with its structure and how it functions?

Many thanks,

Norman

PS Apologies if this is deemed not to be the correct forum for an inquiry of this nature

 
New Post
1/15/2009 7:36 AM
 

Check out this post http://www.adefwebserver.com/DotNetNukeHELP/Misc/ModuleNavigationOptions.htm by Michael Washington.  The bit you need (I think) is near the bottom. 

Michael's post got me 'over the hump' (thanks Michael) and I am using the multiple definitions method very successfully.


Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
1/15/2009 8:59 AM
 

Hi Norman,

the Blog module is an interesting example of using both dynamically loaded controls and multiple definitions. Dynamically loaded controls are used to manage what content should be displayed in the main view, depenging on what is sent through the querystring. Multiple definitions are used to add multiple modules to the page when adding the module to the page. You will notice that each one of the five controls that load in the page is a different module, with a different mdouleID. This is because each of them is a different definition of the desktop module Blog. Each of them accomplishes a different task, and communication between them is done through the querystring: try clicking the calendar to see an example on how entries are sorted based on their publish date. Lastly, when edit controls are loaded, DNN automatically hides all the other controls, so the administrator can perform editing tasks. I hope my explanation was clear, if not, please feel free to ask more.

Best regards,
Dario Rossa

 
New Post
1/15/2009 11:31 AM
 

Thanks for the pointer Richard - that's a very handy summary. After a bit more digging around I came across this post which may also be of help to other budding module developers - http://www.ifinity.com.au/Blog/Technical_Blog/EntryId/48/Designing-Structuring-and-Architecting-DotNetNuke-reg-Modules/

 

 
New Post
1/15/2009 12:42 PM
 

Hi Dario - thanks for the explanation. It's certainly clearer but I hope I can pick your brains a bit more...

So to start with all that is required to load multiple modules to a page is to create multiple definitions? (The more I find out about DNN the better it gets!).

I see from the Module Definitions page that the View_Blog definition contains a control called View Control (with source DesktopModules/Blog/MainView.ascx). From the codebehind file I see that this is dynamically loading other controls - some of which aren't defined as controls in any module definition list (e.g. BlogFeed.ascx). Could you tell me (i) is the dynamic loading of controls generally used in cases where you have multiple controls of type View, and (ii) why some controls are defined and others are not?

In looking at the Blog_List and New_Blog definitions I see that they are also comprised of multiple controls but that the default control doesn't dynamically load controls - rather the NavigateURL and EditUrl methods are used. Could you offer an explanation as to reasons for the differing approach compared to the above method (i.e. is the dynamic loading of controls generally reserved for controls of type View?).

You mentioned that communication between modules is done using the querystring. Are you familiar with or do you know if Inter-Module Communication was ever considered as an option (see http://www.kemmis.info/blog/archive/2008/02/22/dotnetnuke-inter-module-communication-or-how-your-modules-can-get-their.aspx). I was thinking of using this method but before starting down that path I was wondering if there were known issues with this method when using the Blog type architecture (or was it simple overkill - it does seem a bit more complicated?).

I could go on but I better stop! Thanks again for the help.
 

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsBlogBlogHelp me to understand module architectureHelp me to understand module architecture


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