DNN Blogs

Written for the Community, by the Community

Convincing developers to use Structured Content

Written By Aaron Lopez

The following was originally written in the DNN Open Help Slack on a thread where developers were discussing the merits of structured content in DNN. This was my response to people who were hesistant about using structured content modules, like 2sxc. This has been edited since the original response.


You can still use the HTML module if you want...

Structured content doesn’t take over the entire site. When I first started using 2sxc in 2014, it was for 1 module - a staff listing. All other modules were HTML. Then as I started using it more I realized how it could be used for everything. You always have a “trap door” so to speak and there’s nothing stopping you from using the HTML module alongside 2sxc.

But you can make a better HTML-like module

Of course, it’s super easy to make a 2sxc version of the HTML module but improve upon it. For example, I have one HTML-equivalent content module that (through validation) forces the content editor to put in a Title which is then used for the module setting's Title but then give them presentation options to hide it. That way, the modules in DNN get named properly (instead of Enter Title) and the content editor doesn’t have to learn module settings to change containers. This also simplifies the containers as I use none.ascx for everything basically. Then, of course, I also put in a TinyMCE field which is just a simpler, nicer rich text editor than the CKEditor. 

On top of that, because I have control over the content and the template, I can swap out .Normal with Tailwind CSS’s “prose” class, and I can even add in a Buttons field so users can put in a primary action button. So now users aren’t having to learn how to apply classes in HTML to get those buttons.

Editing across the site becomes standardized

Other beneficial side effects are that you standardize the editing experience for yourself and your content editors. They don’t even need to go into edit mode if you don’t want them to. In 2sxc, you can even customize the edit controls and the colours of the edit controls so it’s even easier for your users to understand what to click. Because you're using the same module, your users see the same edit controls. So instead of getting a different editing experience between modules, they get the same point-and-click and drag-and-drop experience.

Less modules, less maintenance

And if you learn how to inject the module into the skin (1 line of code), you can make maximally editable mega menus or editable footers that use 1 module and you don’t have to use “apply module to all pages” thereby reducing your maintenance.

There are things you can do with structured content that you can’t do with HTML module. Another example is I made an 2sxc OpenGraph module that lets content editors customize the OpenGraph content and image without having to learn HTML and edit page settings. I’ve also made listing and resource 2sxc apps that have maybe 50 or 60 items. So that’s 50 or 60 DNN pages that I don’t have to manage themes and modules for.

When you use structured content modules instead of HTML modules or other modules that are made for specific things, you reduce the number of modules you have to install and maintain on a site.

End of rant

People talk a lot about the benefits of using structured content like it’s an added benefit to things, and that’s true - but I would go as far as to say that if you don’t use it, you’re making your life and your user’s lives a lot harder.

Total: 2 Comment(s)
This is awesome. The venerable HTML Module feels ancient and out of place nowadays. Structured Content - both the concept and tool(s) - are definitely the type of thing where is takes a little more effort to get to intermediate, but when the lightbulb finally goes off, its more like fireworks and you can never go back.
Wednesday, September 1, 2021 ·
Completely agree Aaron. On top of all of that it helps with consistency. When using structured content, it's much harder for the content editors to "mess up" the site or stray too far from the design / style guide. Designers and front end devs will probably love how much more they can do with things like images, e.g. I know you've been working with things like the `picture` element and `img srcset`. That sort of thing opens up all sorts of performance and art direction opportunities which are difficult or even impossible with the regular HTML editor.
Wednesday, September 1, 2021 ·

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved