DNN Guide Module Development Best Practices

Clarity eCommerce | The eCommerce Platform to Scale and Grow Your Business
Importance of Carefully Selecting Your Vendor and Understanding The Development Cycle

Introduction to DNN Custom Module Development

DNN, formerly known as DotNetNuke, has been around for a while. One of its editions, called DotNetNuke Professional Edition, was launched in February 2009, with version 4.9. Four years after that, in July 2013 to be precise, this edition was renamed Evoq Content. Furthermore, the DNN platform is open-source software, which is distributed under an MIT License. With that, it means website owners wouldn't need much technical knowledge before operating their site and adding any functionality that's not available in the DNN core modules.

DNN platform is now becoming popular by the day, not just as a blogging platform but also as a Content Management System (CMS). Many organizations, both small and large, are already making use of the platform for their day-to-day website needs. For you to get the best out of your DNN website, you'll surely need to add more functionalities to it.

DNN Guide Module Development Best Practices

While there are several forms of extensibility for the DotNetNuke platforms, the most common one is module development. Speaking of that, it's worth knowing that you can handle the custom development for DNN modules in several ways, using tools such as Visual Studio 2010 and 2012. Apart from that, you can also make use of WebMatrix and express (free) editions of Visual Studio for the DNN module development.

In this article, I'll be sharing with you some of the best practices for DotNetNuke module development. However, before we go into that, let's have a look at some of the important things that you need to know about DNN modules. In case you're already familiar with "module", you can skip this part and move over to the next section, where we'll be discussing the DotNetNuke module development best practices. But, in the case you're new to DNN and would like to know about DotNetNuke modules, this is for you.

Where Can You Get The Modules?

What Are DNN Modules?

What Are DNN Modules?

By definition, modules are software components that contain one or more routines. Also, it represents a set of reusable code, which can be installed into any DNN site. One interesting thing about a DNN module is that you'll be able to drag and drop them with ease to a page after installing them.

Furthermore, as a website owner, it's worth knowing that you can have multiple instances of the same module on a single web page. Also, you can share the modules across different pages and in the paid versions of DNN. Although it's also possible for you to share your DNN modules across multiple sites, it's worth noting that you'll only be able to do that through the Site Groups feature. Out of the box, DNN comes with some modules, called the DNN core modules. The issue with that, however, is that you won't be able to use them for a lot of functions.

How do I mean? Ok, let's take for instance you need a photo gallery module on your website, you won't be able to install it from the core modules mentioned above. That's because DNN doesn't come with a photo gallery module out-of-the-box. However, you need not worry too much about it, as there exist several third-party photo gallery modules that can take care of such needs. Speaking of third party modules, the DNN ecosystem has recommended some stores, where you can find relevant modules for your DotNetNuke site. One of them is the DNN Store. You can visit it by checking this page. In the store, you'll find several modules that can help you perform all kinds of functionalities on your DNN website. However, you'll have to pay before getting the chance to install them on your web page.

In case you have little or no budget and you need some DNN modules for your website, you need not worry too much about it. That's because there are also some platforms, recommended by DNN, which offer their codes as "open source". As such, you'll be able to download and install several modules from them for your DotNetNuke website. On GitHub, you can find some of the best modules for your web page at zero cost. Just like the first two platforms, you can also check DNN Forge for some free modules.

Module Development and Best Practices for DotNetNuke

The Best Practices

Set Up Your Environment

For you to get started with the DNN module development, the first thing that you need to do is to set up your environment. This involves a few steps, including choosing the right DNN version, opting for the right package, and then the installation configuration. You can read more about that by checking this page.

Modify a Visual Studio Template

After setting up the environment, what's next is to modifying a Visual Studio Template. In case you're wondering where to find the template, you need to stop worrying about that. You can check here for them and customize them to your desired taste.

Creating a Project

Having installed the Visual Studio template(s) as mentioned above, it's time to create a project. In case you're ready for that, you can check here for the step by step guide on how to get started, according to DNN. For a visual illustration, you can check this video, created by Clinton Patterson.

The Do's

Starting with the Dos, when you're generating a link, you need to make use of DotNetNuke Common Globals NavigateURL. Apart from that, you must inherit your module controls from DotNetNuke Entities Modules PortalModuleBase. Lastly, in case your modules utilize jQuery, ensure to make use of the necessary framework calls. The purpose of that is to rest assured that only one copy is loaded.

The Don'ts

First, you must avoid using session variables while developing your DNN modules. The reason for that is because it can cause several issues to your site, especially when you're running them in webfarm scenarios. Apart from that, you must also avoid trusting user input. Since that's the case, you'll need to make use of the PortalSecurity InputFilter methods, to filter the content whenever you're accepting any user input.

Performance Tips

For better performance of your DotNetNuke modules, ensure you make use of the following settings in your web.config file. The purpose of that is to help you improve speed for recompilation. That said, here’s the setting: <compilation ... batch="false"> ...</compilation>

Related Posts