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.

2sxc-Polymorph (Multi-Editions) enables Open-Heart Surgery

Almost everybody works on the production environment to make changes and bugfixes, risking a lot. The new Polymorph feature let's you do this without the risks. 

Note that this is not a complete solution yet. We're working on this and have parts of it working, and will add functionality step-by-step.

Let's compare the perfect multi-edition (polymorph) setup to the classic solution:


Work in Progress

app-polymorph-progressAs of now (2sxc 9.35) we have achieved the first step, allowing the WebAPI controllers to be polymorph. So this is the current state of development:

This means that:

  1. Api Controllers are already fully polymorph. They can be placed in a subfolder like [app-root]/live/api/WtfController.cs and can be accessed using a url with the edition in the name, allowing multiple identically named controllers to be used.
  2. Views are polymorph if you do the view selection manually. This means, you can place your views in a subfolder like [app-root]/live/list.cshtml and then have an entry-point [app-root]/list.cshtml which will choose which edition to use - then using @RenderPage to pick that edition. This is still manual, because we're not sure yet what the perfect implementation is, so we would rather wait before standardizing a bad solution.
  3. Everything that is data (schemas, items, queries, settings and resources) is still one edition only. The data model is able to perform multi-edition content-management, but we're not ready yet to provide the UIs etc. for this, as it could lead to confusion, so we'll hold back on this for now.

How to use WebApi Polymorph (2sxc 9.35+)

As of now, to use the WebApi Polymorp, this is what you would do:

  1. instead of placing your WtfController.cs in the [app-root]/api/ folder, you place it in a [app-root]/live/api folder.
  2. the live, default JS would then access it using
  3. You can then copy this controller to [app-root]/dev/api and make your changes there.
  4. In your JS, you would then (while testing/developing) access this edition using
    without causing problems on the live solution, as all other users are still accessing the liveedition, while you're working on the dev edition.
  5. Once everything works, deploy (copy) the now modified WtfController.cs from the dev/apifolder to live/api and all users benefit from the changes.

How to use Views Polymorph (manually)

As mentioned above, this isn't automated yet, but the vision is clear, and it works ca. like this:

  1. place your real views - let's say list.cshtml not in the [app-root]/list.cshtml but in an edition folder - like [app-root]/live/list.cshtml.
  2. In the root, also create a [app-root]/list.cshtml, but this will basically just render the file from the editions folder, using @RenderPage("live/list.cshtml")
  3. Now, determine how you want to switch between editions - for example based on a cookie value or host-user. Add this logic to the [app-root]/list.cshtmlto determine the edition you want to use, and based on this if()...else() render either the live/list.cshtml or dev/list.cshtml
  4. Now you can work on the dev/list.cshtml without affecting live users.
  5. Once it's ready, deploy (copy) the dev/list.cshtml to live/list.cshtml

Next Development Steps

Next in line, we want to standardize a few things, like:

  1. Providing a UI or something to move/deploy one edition to another, so that you can work in staging, and then use a UI or something to deploy your work to live. This should also auto-backup what was in live before, in case you want to roll back.
  2. Standardize how a to automatically determine which "morph" a user is in and how to set the user to this morph, making it easier to use and removing the requirement for "switcher-views" which determine which real view to show.

For now, Data-Polymorphism is low priority, because we're not sure yet if we can "pull this off" in a way that won't confuse the users.

Getting Started

  1. Download the latest 2sxc from Github
  2. Get the latest documentation on the 2sxc wiki, specifically the Polymorph-concept, WebApi docs and DotNet WebApi docs.

Love from Switzerland,

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 800 DNN projects since 1999. He is also chief architect of 2sxc (see github), an open source module for creating attractive content and DNN Apps.

Read more posts by Daniel Mettler

Just download 2sxc from Github and test it under DNN 9.2 site, love it very much. Thanks. Thursday, February 21, 2019 2:55 AM (link)

Comment Form

Only registered users may post comments.


Aderson Oliveira (22)
Alec Whittington (11)
Alessandra Davies (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