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 ExtensionsModulesModulesBasic Help w Custom Module... How do I make one Module do multiple things?Basic Help w Custom Module... How do I make one Module do multiple things?
Previous
 
Next
New Post
4/14/2010 11:32 AM
 

So I'm SLOWLY starting to maybe hate dnn slightly less, but there's one major thing that still drives me crazy, and that's how I've been having to create multiple modules to do things that, seemingly, should be included in a single module.  I know it's possible to do this, but the hell if I can figure it out...

I'm creating extremely simple modules with, typically, just a View and Settings controls; this is working fine, but what I'd like to do is some other views with a Module instead of creating new modules every time I want to add something.  My specific example right now is as follows:

I have a Survey module (completely custom) that contains View and Settings.

I wanted to report on the answers, so I created another module containing a View control that displayed the answers

I also want a way to display the Survey formatted for printing, so I've created a "Print_Survey" module.

 

It seems like I should be able to encapsulate all of this functionality within the same Module, but I can't figure out how to do this.  Can someone point me in the right direction, please?

Thanks!!

 
New Post
4/14/2010 12:01 PM
 

You need to add something called 'Actions'. It adds entries to the 'Action' menu for the module.

The Steps:

1) Have your module inherit IActionable [in DotNetNuke.Entities.Modules]

2) In your class, add the following [formatting to reduce space]
public ModuleActionCollection ModuleActions{get{
ModuleActionCollection actions = new ModuleActionCollection();
}}

3) To add an "Edit" action, place the following line after the 'actions' declaration

actions.Add(GetNextActionID(), "Edit", ModuleActionType.AddContent, "", "", EditUrl(), false, DotNetNuke.Security.SecurityAccessLevel.Edit, true, false);

4) To add other, custom, options in the action menu, it will look something like this

actions.Add(GetNextActionID(), "TEXT IN MENU", ModuleActionType.AddContent, "", "", Globals.NavigateURL("CONTROL_KEY", new[] { "mid/" + ModuleId }), false, DotNetNuke.Security.SecurityAccessLevel.Edit, true, false);
The "TEXT IN MENU" is what will appear in the module menu.
The "CONTROL_KEY" is determined in the dnn manifest when the module is installed, or assigned through the module definition interface.

4.1) Add return actions; to the end of the 'get'

5) To include the new ascx and it's functionality to the module's installation, add a new 'moduleControl' section to the dnn manifest with the CONTROL_KEY entry filled out.

 

All of this assumes you've created a new ascx in your project. For my additional controls, I keep them in the same namespace, but their own class. Mine are set up almost identical to my standard module view ascx file. I can't think of anything off the top of my head, nor looking at one of my additional functionality ascx files. The template I use actually generates both from the same file with only a few minor flags for some custom stuff I do.

I hope that helps.
 

 

 

 
New Post
4/14/2010 12:33 PM
 

 Thank. You!

Most of this looks pretty straight-forward; I am working through it now.

Very much obliged for the information. :)

 
New Post
4/14/2010 12:39 PM
 

 I've made an update to a previous post I made for the most basic steps to create modules and added some more explicit steps for doing this.

 www.dotnetnuke.com/Community/Forums/tabid/795/forumid/118/postid/349747/scope/posts/Default.aspx#349747

Hope all that helps. :)

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesBasic Help w Custom Module... How do I make one Module do multiple things?Basic Help w Custom Module... How do I make one Module do multiple things?


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