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.


The Future of DNN Speaks Razor - #6 - Mapping Needs to Technologies

I've written a few posts in my series The Future of DNN Speaks Razor explaining why many technologies are obsolete or going that way. I've also mentioned a few neat new things and as a kind of summary, I will recommend what HTML-creation technology to use for what part of each application.  

What HTML5 Offers Today

Based on this (already old) graphic, you can easily see that the modern client supports just about anything you can dream of. So all we have to do is figure out what's left for the server to do.

Mapping Specific Types of Output to Recommended Technologies

Admin User Interfaces
like configuration dialogs

Content Input
like edit-dialogs for your data

Use

  1. Simple HTML-forms or client SPAs (Single-Page-Applications)...
  2. ...based on AngularJS (or knockoutJS if need be)...
  3. ...receiving and saving data through WebAPI (ideally the DNN-flavor with security-checks etc.).

Avoid

  • All WebForms-Controls (like Labels, Input-Boxes, etc.), especially the built in Telerik Controls (these are not updated any more)
  • Avoid Postbacks and ViewState at all cost, they are history.

In-Page Content Editing
In-Content Editing Dialogs

Use

  1. This is mostly done in JavaScript (jQuery or AngularJS)...
  2. ...simple editable DIVs and form-elements
  3. ...receiving and saving data through WebAPI (ideally the DNN-flavor with security-checks etc.).

Avoid 

  • All WebForms- & Telerik-Controls, Postbacks and ViewState
  • Don't compensate ViewState with Session-State - this will fail in the long run

Module Front-End Views
like a login-control or contact-form

Use

  1. You will often need some custome HTML, so use C# Razor for the HTML-generation
  2. Use jQuery for the front-end logic (like input-field validation) 
  3. ...and a JSON/WebAPI interface for processing the data. 

Avoid 

  • All WebForms- & Telerik-Controls, Postbacks and ViewState

Interactive Module Front-End Views
like galleries, charts, image-rotators

These usually consist of an initial HTML fragment containing some data (like DIVs containing images) and a feature rich script. Use: 

  1. The script are made with AngularJS, jQuery or specific third party JS libraries like TimelineJS
  2. To deliver html-data (usually list of something) you will need C# Razor or DNN-Tokens
  3. for any kind of JSON feed either use a standard WebAPI or a module specific JSON-feed
  4. Module-instance configuration (usually just 1 record containing animation speed etc.) is usually delivered in the HTML as inline JSON to avoid unnecessary extra requests.

Avoid

  • All WebForms- & Telerik-Controls, Postbacks and ViewState

Content-Element Output
like images, videos, simple text/image combinations, addresses, product-details etc.

Most of these templates are simply responsive HTML-fragments with minimal logic. They must place the content-data inside the HTML for SEO-reasons and should be easy to customize. Use

  1. The ideal solution is C# Razor or DNN-Tokens
  2. Token-templates offer a security benefit since they contain no code but are not flexible
  3. C# Razor templates are power-edition
  4. Use Server-Side Image-Resizers to auto-resize/crop your images [todo]

Avoid

  • All WebForms- & Telerik-Controls, Postbacks and ViewState
  • ...especially data-bound WebForms templates
  • XSLT - this is sometimes used, but most developers are very louse at it, so even though the technology is great, it's not good for this requirement. Also note that XSLT is almost dead in Web-Output - most CMSs that went for this approach have moved on, a bit like XML-Streams being replaced by JSON
  • Don't use you own invented "improved" engine. Your solution might be better than Tokens, but it's unlikely that you'll create anything better than Razor

Content-List Output
like lists of news, list of products and similar

These are usually designed/responsive table-like lists of things like news, downloadable files etc. Use:

  1. C# Razor to ensure that you can also apply some custom formatting, hide some items based on rules etc. 
  2. DNN-Tokens might be used, but are usually too trivial for good lists

​Avoid

  • Everything you should also avoid in the list above...
  • ...especially data-bound WebForms templates

Data-List Output
like feeds from external sources, lists of data from a DB

These are usually designed/responsive table-like lists of things like news, downloadable files etc. Use:

  1. C# Razor to ensure that you can also apply some custom formatting, hide some items based on rules etc. 
  2. DNN-Tokens are usually too trivial for good lists.

Avoid

  • Everything you should also avoid in the list above...
  • ...especially data-bound WebForms templates

End-User SPAs
Single Page Applications meant to react quickly but still get indexed by Google.

These are currently the most challenging of solutions. In brief: 

  1. create them client-side using AngularJS and similar
  2. Deliver the data throughWebAPI or custom JSON
  3. To ensure SEO, use Hashbangs for application state...
  4. ...and create C# Razor fallback-views on the server (processing the _escaped_fragment_ URLs) to deliver search-engine HTML. Note: Most people don't understand what I just wrote here - I'll blog about it in detail one day.

Avoid

  • Don't create them with server-side rendering or any of the WebForms-solutions
  • Don't create complex solutions with jQuery only - this always works at first, but development time grows exponentially with complexity. So always use...
  • ...a good client side MVC-Framework like AngularJS. Avoid knockoutJS, as it doesn't even offer real View-Management, so is too trivial for SPAs

Note to Module Developers

If you are a module-developer, make sure you support Razor as your templating-engine of choice. Ideally, make sure the templates are stored in the portal-folder and that your module can work with portal-specific templates. If possible, also add ways to publish your data as JSON to empower the web designer to create awesome alternate consumption paths like neat JS-lists or even crazy AngularJS SPAs (Single Page Applications). 

 Avoid ASP.net WebForms/WebControls and XSLT at all cost. 

Also avoid VB Razor since it's not widespread.   

A Note to Web Designers 

If you are a web designer, make sure you choose content-management modules supporting Razor - because everything you customize in Razor will still be "the right way" in 5 years. Everything you do in XSLT or WebForms is a bad investment of your time and your customers money. When you want to create something cool - like an interactive list or chart - do it in JavaScript. Postbacks and Server-Rendering are soooo 2004.  If possible, motivate your module-developers to support both Razor and JSON interfaces. 

An Example how This Should be Done

Since we (2sic) are so keen on these technologies, our content-management module 2sxc supports exactly these setups, but I'm sure that many others do too. 

Since 2sxc does almost everything including galleries, image-rotators, product lists/details, SPAs etc., I've stopped reviewing other modules, so I can't recommend any. I do believe that XMod and Form&List are going there, but are still focused on historically popular technologies like XSLT and WebForms. If you can recommend any further solution please mention it in the comments.

Summing Up

I hope I've inspired you and helped you see the web-world as it functions today. Of course, this leaves a lot o post about, including the following:

  1. Razor-Basics and advanced Razor-stuff (like grouping using LINQ) - this will need a series...
  2. For module developers: How to integrate Razor as your View-Engine while you're still hooked on WebForms
  3. AngularJS basics - another series (anybody want to write this one - post in the comments)
  4. JSON and WebAPI basics - also a series (anybody want to do this - post in the comments)

With love from Switzerland
Daniel

Daniel Mettler grew up in the jungles of Indonesia and is founder and CEO of 2sic internet solutions in Switzerland and Liechtenstein, an 20-head web specialist with over 600 DNN projects since 1999. He is also chief architect of 2sxc (2SexyContent - see forge), an open source module for creating attractive content and DNN Apps.

 

PS: Want to get started before the entire Razor-series is out? For the impatient, try the DNN-Razor Host Module and watch this video  or try packaged code apps by installing 2sxc and some of the Razor Apps like the Razor Basic TutorialsList-Tutorials or the SQL and Peta-Poco Tutorials

 

Comments

Jordan
thanks daniel for the series.
I read them all and agree whole heartedly with you. All sizes of business are even using these technologies to host a single business solution for their information in the cloud, without the in house server ( solving the complex need for keeping data consistent between in house and online data stores) and allows resources to be focuses in one place.

I like the idea of using angular for the more complex modules, but feel it might be a bit of over kill for the simple modules and like to use knockout when the data binding requirements are simple.

In addition, I can not emphasises enough how much I want DNN 8 to move this way. If DNN can remove the mark up bloat the exists around modules and leave the majority of the styling to frameworks like bootstrap and foundation through skins, then you have a truly modern CMS which builds upon the primary strengths of DNN, which IMHO are its flexibility and extensibility.

I look forward to the future of DNN and strongly believe it is the best CMS out there.
Jordan Wednesday, September 3, 2014 3:13 PM (link)
Jay Mathis
Fantastic series Daniel! I learn best from seeing real world examples and would love to see this implemented with a simple How To sample module. Looking forward to the next post!
Jay Mathis Wednesday, September 3, 2014 5:20 PM (link)
Daniel Mettler
@Jordan: I understand that you see AngularJS as "too powerfull" for many scenarios.

The reason we are completely dumping knockoutJS ist standardization and Knowledge Management. We have 17 employees - and teaching each and every one the differences between the frameworks, the quicks, the bugs and the issues takes a lot of time. If you add the time you need for internal documentation and for additional problems which arise when people confuse the two technlogies then you have a very, very expensive system.
Reducing it to 1 technology does increase the learning curve once for every employee - but it so much cheaper than maintaining 2 similar solutions for similar problems.

It's also a protection: simple solution tend to migrate into complexity and bam! you hit a wall. If you start in Angular this won't happen.

And third: once you learned angular, creating simple solutions doesn't take any longer than with knockoutJS.

With love from Switzeland,
Daniel Mettler Thursday, September 4, 2014 1:52 AM (link)
Jordan
Hey Daniel

Those are great points that I never thought about. That's why I appreciate being a part of a community so much. It helps you to make better decisions.

Jordan

ps - any idea when your 2sxy content module will be azure ready?
Jordan Thursday, September 4, 2014 12:03 PM (link)
Daniel Mettler
@Jordan

The newest build (this weekend, v6.3) is Azure-ready. Please test and do give feedback!

Thanks, Daniel
Daniel Mettler Monday, September 8, 2014 3:25 AM (link)
Erik Hinds
Good series. I liked the post where you showed the umbraco interface.
Erik Hinds Monday, September 8, 2014 11:59 AM (link)
Daniel Mettler
@erik
You're welcome ;). I love a good competition - and it's wonderful that younger projects have more freedom to try things (and optionally mess up) - while more stable/mature solutions can benefit from lessons learned there. Umbraco tried to go MVC and failed big time after more than a years development - now I believe they are one a good track. And DNN is too - and the more we learn from each other, the better all will get.

Love from CH
Daniel

PS: that's Switzerland for you: 4 languages, so the abbreviation CH doesn't make much sense in most of them
Daniel Mettler Monday, September 8, 2014 3:16 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