DotNetNuke Modules – Registering Your Module

Yesterday, we used the DotNetNuke template to create a skeleton module and it’s supporting files. Today, we want to get those modules registered into our Visual Studio copy of DotNetNuke so that as we develop the modules, we can see and test the changes we make.

To register the module, you will need to be logged into DotNetNuke as “host.” Login now and navigate to “Host” > “Portal Module Definitions.”

Once you are there, scroll to the bottom of that page and click the link, “Create Module Definition.” This will lead you to a screen with a lot of fields on it. The first time you come to this screen, you’ll probably wonder how you are suppose to know exactly what you should be doing here. Fortunately, you only HAVE to fill in a small subset.

  • Module Name: Give the module a name. In our case, we are calling it DMBSample
  • Module Directory: The directory your module is located in. Ours is DMBSample
  • Friendly Name: The text that you want to display in the dropdown list of available modules.
  • Descriptions: Describe what this module does.
  • Version: This is the first version, so leave the field with 01.00.00
  • Compatibility: This allows you to specify what version of DNN this module is compatible with. We can leave this blank.
  • Dependencies: List the typename dependencies. Again, you can leave this blank for now.
  • Permissions: Any special permissions this module requires. Leave it blank for this sample.
  • Controller Class: The class that implements ISearchable and IPortable. Don’t worry about this field for right now.
  • Premium: Since we are developing this module, we don’t want it to be limited. Leave this unchecked.

Once you’ve filled in those field, click the “Create” link.

But wait, there’s more…

Now that you’ve defined the main module, you need to tell it where the ASCX files are that make the module work. To start this, you’ll need to create a definition. Fill in the “New Definition” field with the name of the module–in our case, “DMBSample”–and click “Add Definition.”

Now we can add the various controls. Click the “Add Control” link that just displayed after the “Add Definition” completed. This will take you to another screen where you can define the control. The first control we will define is the main view, the presentation that the end user will ultimately see. For this, fill in Title with a title that represents the module, select the ViewDMBSample.ascx file from the “Source” dropdown, and leave the “Type” dropdown as “View”. If you plan to use AJAX with your module, select “Supports Partial Rendering”. That’s all you need to do for this control, so click “Update.”

The template created two other controls. One is the “Edit” control and the other is the “Settings” control. You’ll need to add these in a similar manner as the View. Click the “Add Control” link, and for the Edit control, put “edit” in the “Key” field. For the settings control, type “settings” into the “Key” field. Title can be something meaningful. Select the appropriate control from the dropdown. And for type, use “Edit” for the edit control and “Admin” for the setting control.

If you try to add this module to a page at this point, you’ll see an error message. Just hang on for the next lesson where we show you where the controls we just registered show up in the system and modify the code so that it doesn’t throw an exception.

 

Other post in DotNetNuke - Module Development

Related Post

2 Responses to “DotNetNuke Modules – Registering Your Module”

Leave a Reply

Comment Policy:

  • You must verify your comment by responding to the automated email that is sent to your email address. Unverified comments will never show.Leave a good comment that adds to the conversation and I'll leave your link in.
  • Leave me pure spam and I'll delete it.
  • Leave a general comment and I'll remove the link but keep the comment.

Notify me of followup comments via e-mail

Bear