(734)545-8017

The Human Element Blog

My First DotNetNuke Module

Posted Jun 21, 2011 by

nerds_small

Represent!

Hold on to your pocket protectors! Human Element’s own Gregg Milligan II has completed his first DotNetNuke Module, Sport Events. It is now in Beta Testing… word.

Work on the Sport Events DNN module officially began March 8, 2011. Three-and-a-half glorious months later, it is now a fully functioning module… A real thing of beauty. But the real question is: How did I do it? First things first…

What’s a Module?

If you’ve never heard of DotNetNuke or think a module is some sort of growth, let me fill you in. DotNetNuke is a content management system for web sites. It helps people dynamically control and generate site content.

DotNetNuke is also a development framework. Developers [also known as “Nerds”] code “Modules” that can be plugged-into DotNetNuke, providing a slice of sweet, sweet functionality for the site and a unique interface in the overall management system.

The major place to find and download third party modules is
Snowcovered.com
. There really are some great DNN modules out there! However, the landscape of DNN modules is mostly unregulated. Think of it like the Wild, Wild West of the Developer World. The quality of a module mostly depends on the work of the third-party developer and not all developers regulate their work the same way or try to fulfill the same standards, even though DotNetNuke modules are pretty big business.

My First Module

Here’s the quick run-down of what we were going for:

  • Module Name: Sport Events
  • Overview: “Sport Events” is a sporting events schedule and results management module.
  • Summary: “Manage sport events for your team. Sport events are displayed for visitors to your site. This module is great for school’ and University sports teams. Manage any number of different sports and even report on the results of sporting events. It includes the ability to link box scores and articles for games.”
  • Developed on:

    • DotNetNuke Community Edition: 5.05.01
    • .NET Framework: 3.

Sport Events has three main Admin Categories.

  • Sports
    : Create a list of sports for your portal. You can define sport names and descriptions. You can also view how many events are associated with a given sport at any time.
  • Events
    : Create a list of events for your portal. You can associate an event with one of the sports in the portal. You can assign a date, time, opponent name, location, group name, home result (score), opponent result (score), box score (link to a box score page) or article (link to an article). The events admin also allows you to filter your list of events so that you can easily find and manage your events. There’s even a recycle bin in case you need to undo a terrible mistake.
  • View Options
    : The previous two admin categories applied to the entire portal. However, view options are applied on module instance basis. In this case, a “portal” is not something you’ll find on a submarine. Think of it as a synonym for ‘web site instance.’

    • Display Options
      : Allows you to control the display of events (for this module instance). For example, you can set the number of events to display, whether or not there is event list paging, how events are sorted, what sporting events to include, etc…
    • Templates
      : Defines the HTML template to use for this module instance. You can insert tokens into your HTML templates to get the event values where you want them to appear. A token is a key word, like “[date]” that will resolve to a real value, such as “6/17/2011” when the event information is squirted into the page.

If you don’t create your own template, don’t worry, a default template is used. Yeah, it’s the little things like that, which make a module pretty sweet, but that’s just the tip of the “NICEburg.”

“It’s the Little Things that Count”

…no one knows this more than the end user.

A lot of my work involves getting the most out of them to meet client needs. That’s why I really appreciate when a module is smartly designed and behaves predictably. I kept this in mind when creating Sport Events out of empathy, perhaps, but also because I would also have to be one of the primary users.

Sport Events has many of these “little things” designed to make lives easier, such as including modify timestamps (in case you need to ostracize someone for making a bummer modification), but I won’t cover all of the module’s little cool perks… at least not in this blog post.

Here’s another example of a little thing that can seem like a big thing to an end user.

Scenario 1
: You want to link some text in your template to the event box score. You insert the following code into your template to do this:

listing 1

Great! Now the word, “Box Score” is a link to your box score. Makes sense right? Well… what if you don’t have a box score link defined for your event? Now the word “Box Score” doesn’t have a URL link. Uh oh.

listing 2

Solution
: Well, Sport Events is designed to remove link HTML and inner text that doesn’t have a URL. Great! The problem is solved!

Scenario 2:
You want to link your opponent name to the article about the event.

listing 3

If no article URL is defined for the event, your whole opponent name, along with the link is removed from the output! Uh oh!

What if I include Cross Country into my event list? Cross Country doesn’t have a score, only a rank. The rank would be assigned as the “Home Result.” Therefore, cross country ranks would always be followed by the word “to.” Uh oh!

Everything between the span tags will only be included if the value of the Name attribute is not empty. Therefore, if there is no Opponent Result, the word, “to” will not be included.

Have you died and gone to nerd heaven or what?

What’s Next?

Currently, Sport Events is in the Beta phase. Small improvements or enhancements may be made in response to user feedback from Siena Heights. Once the creative styling is applied to the module, I will put together some screenshots as an addition to this post.

Once the module is proven to be stable, I will look into entering it into the public DotNetNuke module community as a free demo download. Depending on demand, I may make Sport Events available to public community through the normal channels, such as Snowcovered.com.