Why Clydesdale?
Expertise
Blog
Contact
Home
Clydesdale Software Logo


Follow Us: Twitter RSS



Go Back

Looking at Umbraco 7

After much experience and frustration with previous versions of Umbraco I decided to take another look at Umbraco version 7 which is based on ASP .Net MVC.

 

The first thing I like about v7 is the ease of setup, just create an empty web project then install the Umbraco Nuget package which now has the MVC flag set. Next run the project and step through the wizard.

 

At this point you have a functional CMS website. Being a person who likes to customize things I wanted to know how easy it was to insert my own code, i.e. my own controllers and views. Creating partial views to use on pages seems easy enough by creating macros (or macropartials) then adding them via the editor though this is not very MVC. What I really wanted was to have my own controller return a view.

 

One option is hijacking routes in Umbraco, though having to deal with Umbraco’s naming convention and model inheritance seemed not needed and is baggage I did not want.

 

The option I went with is to create my own MVC controller and view. First create a MacroPartial and in it use @Html.Action(“MyAction”, “MyController”) then add the macro to a page via the rich text editor. Of course out of the gate it did not work because that would be too easy. With some quick searching I found that inheriting from SurfaceController is the correct way to create your own controllers in Umbraco. After that all worked fine and I was able to pass my own custom model without inheriting from anything or worry about naming conventions.

 

The other approach and/or addition to the above is to create a webapi controller and use ajax callbacks to bring functionality to partial views.

 

This latest version of Umbraco is a step forward though it still does not have a great answer to scaling horizontally or custom development process. As with many CMS systems out there Umbraco promotes development in production which I’m not a fan. My usage pattern for Umbraco has and always will be treating it as a custom website; create custom pieces in development then deploy to test before production. Simple content is different story, actually anything which goes into the database is a different story.

Facebook Twitter DZone It! Digg It! StumbleUpon Technorati Del.icio.us NewsVine Reddit Blinklist Add diigo bookmark