Products

Solutions

Resources

Partners

Community

About

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!

The Community Blog is a personal opinion of community members and by no means the official standpoint of DNN Corp or DNN Platform. This is a place to express personal thoughts about DNNPlatform, the community and its ecosystem. Do you have useful information that you would like to share with the DNN Community in a featured article or blog? If so, please contact .

The use of the Community Blog is covered by our Community Blog Guidelines - please read before commenting or posting.


Create a DNN Module in Less Than 2 Minutes!

What is it?

generator-dnn is a Yeoman plugin to scaffold out DNN Modules. You simply run the command

yo dnn
and answer a few questions. Based on your answers the structure for a module is created and you can start coding. This works completely from the command line and has no dependency on Visual Studio. Over the years there has been a trend to move towards command line tools and code editors instead of using full-blown IDEs.

How do I get Started?

Getting started is super simple and fast!

First, you need to install Node.js. If you do not have Node installed already you can grab the installer here: https://nodejs.org/en/download/

Now that Node is installed you can open a command line and install Yeoman. Simply type

npm install -g yo

Now you can install the DNN generator.

npm install -g generator-dnn

Now you need to install Gulp. Gulp is a task runner that automates several pieces in the build.

npm install -g gulp

That's it! You are all set up.

Generate Your First Module

Let's create a SPA module using the generator.

Open a command line. Create a directory where your modules will be stored. Go into the directory and generate your module.


        mkdir mytest
        cd mytest
        yo dnn
    

You will be prompted with a few questions.
Initial Yeoman Questions

Select SPA Module Answer the rest of the questions that the generator asks you. After answering the rest of the questions the generator will create the directory structure and then download any related packages necessary.
Rest of Yeoman Questions

What you end up with is a solution file in the directory you are currently in with a sub-directory containing your module. One thing you won't see is a License.txt or ReleaseNotes.txt files. Instead, you see License.md and ReleaseNotes.md. This allows you to use markdown to create your License and Release Notes (It also allows GitHub to render your content nicely). When you build the module using the command line it will automatically convert the markdown to HTML and generate the proper text files for the install package. From here you can develop your module through any code editor you wish. Once you are ready to install and run through some tests you can run the build to generate the proper installers.

Let's run the build! If you named your module mytest like in the example you can go to this directory and use npm to build your packages. This solution uses some Gulp.js scripts and MS Build to build your module. Simply type

npm run build

Build Output

After the module is built the DNN install packages will be created under the _Packages directory. You can now load your module into DNN through the Host Extensions installer.
Packages

That's it! generating a structure for your DNN modules has never been simpler.

What is coming?

This tool is in its infancy still. I have been getting lots of feedback from users that have been piloting this tool and they love it. We will be adding the following soon:

  • A scaffolder for Persona Bar projects.
  • A theme scaffolder that will leverage nvQuickTheme.
  • Codelab style tutorials.

We will also be adding a development pattern that easily allows you to develop directly inside a DNN instance. The tool currently assumes you are outside of a DNN instance because that is normally how I develop. I don't have DNN installed locally on my machine. I simply develop my solution and create unit tests and then run through the installer on a central dev environment that is shared between developers. If you have any ideas or want to contribute to the project please head over to GitHub. The project is located at https://github.com/mtrutledge/generator-dnn

Comments

Will Strohl
Outstanding blog post and I've been loving the DNN generator. It's saved me a ton of time already and it's still brand new! :) Thank you so much for your contribution to the community, Matt!
Will Strohl Friday, June 29, 2018 10:24 PM (link)
David Poindexter
Matt, great blog post. Thanks so much for sharing this fantastic tool with the community! I have some ideas that I will share via GitHub as to not clutter up the comments here. :)
David Poindexter Friday, June 29, 2018 10:45 PM (link)
Ralph Williams
Thanks for the fantastic tool, Matt! And thanks a bunch for this walk-through. I've been exploring with this for the past few days and it looks like a great improvement to catch us up to modern development practices.
Ralph Williams Friday, June 29, 2018 11:11 PM (link)
Clint Patterson
So much goodness! Thanks for creating this, sharing it with the community, and providing this guide. You rock!
Clint Patterson Sunday, July 1, 2018 6:52 PM (link)
Timo Breumelhof
Nice!
Timo Breumelhof Monday, July 2, 2018 2:05 PM (link)
Matt Rutledge
Thanks for the kind words guys! I look forward to improving this tool with the communities feedback!
Matt Rutledge Monday, July 2, 2018 3:08 PM (link)
Will Morgenweck
This is a great tool! One thing you might want to update in the tutorial is that you need to have gulp installed too. I was testing this out on a new dev environment which didn't have gulp installed yet so I received a few errors running "yo dnn". Once I installed gulp everything worked perfectly! Nice job!
Will Morgenweck Monday, July 2, 2018 9:02 PM (link)
Sebastian Leupold
Great Job!
Sebastian Leupold Monday, July 2, 2018 10:40 PM (link)
Matt Rutledge
Thanks, @Will Morgenweck. I have updated the tutorial to add a Gulp install.
Matt Rutledge Tuesday, July 3, 2018 2:42 PM (link)
Olly H
This thing is ace! I'm a complete newbie to DNN module development and want to build a React SPA module, so this is a huge help. Thanks for building it :)
Olly H Thursday, July 5, 2018 2:24 PM (link)

Comment Form

Only registered users may post comments.

NewsArchives


Aderson Oliveira (22)
Alec Whittington (11)
Alessandra Daniels (3)
Alex Shirley (10)
Andrew Hoefling (3)
Andrew Nurse (30)
Andy Tryba (1)
Anthony Glenwright (5)
Antonio Chagoury (28)
Ash Prasad (37)
Ben Schmidt (1)
Benjamin Hermann (25)
Benoit Sarton (9)
Beth Firebaugh (12)
Bill Walker (36)
Bob Kruger (5)
Bogdan Litescu (1)
Brian Dukes (2)
Brice Snow (1)
Bruce Chapman (20)
Bryan Andrews (1)
cathal connolly (55)
Charles Nurse (163)
Chris Hammond (213)
Chris Paterra (55)
Clint Patterson (108)
Cuong Dang (21)
Daniel Bartholomew (2)
Daniel Mettler (181)
Daniel Valadas (48)
Dave Buckner (2)
David Poindexter (12)
David Rodriguez (3)
Dennis Shiao (1)
Doug Howell (11)
Erik van Ballegoij (30)
Ernst Peter Tamminga (80)
Francisco Perez Andres (17)
Geoff Barlow (12)
George Alatrash (12)
Gifford Watkins (3)
Gilles Le Pigocher (3)
Ian Robinson (7)
Israel Martinez (17)
Jan Blomquist (2)
Jan Jonas (3)
Jaspreet Bhatia (1)
Jenni Merrifield (6)
Joe Brinkman (274)
John Mitchell (1)
Jon Henning (14)
Jonathan Sheely (4)
Jordan Coopersmith (1)
Joseph Craig (2)
Kan Ma (1)
Keivan Beigi (3)
Kelly Ford (4)
Ken Grierson (10)
Kevin Schreiner (6)
Leigh Pointer (31)
Lorraine Young (60)
Malik Khan (1)
Matt Rutledge (2)
Matthias Schlomann (16)
Mauricio Márquez (5)
Michael Doxsey (7)
Michael Tobisch (3)
Michael Washington (202)
Miguel Gatmaytan (3)
Mike Horton (19)
Mitchel Sellers (40)
Nathan Rover (3)
Navin V Nagiah (14)
Néstor Sánchez (31)
Nik Kalyani (14)
Oliver Hine (1)
Patricio F. Salinas (1)
Patrick Ryan (1)
Peter Donker (54)
Philip Beadle (135)
Philipp Becker (4)
Richard Dumas (22)
Robert J Collins (5)
Roger Selwyn (8)
Ruben Lopez (1)
Ryan Martinez (1)
Sacha Trauwaen (1)
Salar Golestanian (4)
Sanjay Mehrotra (9)
Scott McCulloch (1)
Scott Schlesier (11)
Scott Wilkinson (3)
Scott Willhite (97)
Sebastian Leupold (80)
Shaun Walker (237)
Shawn Mehaffie (17)
Stefan Cullmann (12)
Stefan Kamphuis (12)
Steve Fabian (31)
Steven Fisher (1)
Tony Henrich (3)
Torsten Weggen (3)
Tycho de Waard (4)
Vicenç Masanas (27)
Vincent Nguyen (3)
Vitaly Kozadayev (6)
Will Morgenweck (40)
Will Strohl (180)
William Severance (5)
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out