Tuesday, 10 May 2011

Real world Orchard CMS – introduction.

So, I’ve been a bit quiet here recently, mainly because I’ve been absolutely swamped with a re-architecture project for a pretty major client, but any free time I did have I’ve been using it to learn about Orchard CMS. As you, yes you, you’re the only person that reads my blog… as you may know, I’ve had my own CMS for a number of years (http://www.fluxcms.co.uk or http://flux.codeplex.com), but with pressure of work I’ve not had much time to update it or add new features and to be honest, now that Orchard has released v1.1, I really don’t see much point in taking flux forward – Orchard kicks it’s ass to the ground and stomps on it’s private bits.

What is Orchard – it’s and ASP.NET MVC content management system, backed by Microsoft and is Open Source!
If you haven’t heard of Orchard, I strongly encourage you to go look at it now – http://www.orchardproject.net or http://orchard.codeplex.com – it’s well designed and uses some great technology like ASP.NET MVC3, the new Razor view engine, NHibernate for persistence, AutoFac for DI/IOC and it’s got a nice, active and helpful community. The key people on the project are Microsoft employees and MS have kindly funded the project up to this point, and presumably will continue to do so in the future, but there is a reasonably vibrant, and growing, community around the product.

Learning Orchard
Anyway, I needed to build a site for a friend of mine who is shortly launching a set of premium SharePoint components and solutions and for this he needed a website to promote and sell his wares, I volunteered to help out as his requirement would touch on most areas of Orchard and gave me a good reason to dive in with a real world example that I could then reskin and make open source for the basis for this series.

Learning orchard was quite straight forward, the source is available and there is some good documentation on the site – the recent release of v1.1 was also a godsend (take a look at the new shape tracing features to see why). What I did find though was as I started to go beyond the basics of modules and skins, the documentation was a little light, but the community made up for this, with regular and prompt answers to questions and some good overall advice. (big up to bertrandleroy and randompete on the forums for all their patience and help!).

I hope that this series will help other newcomers to adopt this CMS and grow the community further.

And so, without further ado, the scope of the site is for a fictitious company that makes premium components, themes and modules for orchard. They require a site which features;

  • Nice(ish) site design
  • Homepage layout with
    • an aggregation of recent content, both from the site and from external sources (eg: Twitter)
    • a promotion area to have the most recent product promoted
  • Blog to post articles, tips and announcements for the products
  • Rudimentary general pages
  • A list of products they sell
  • Product sections – each product will feature;
    • Separate pages for main product overview, features etc.
    • Ability for users to rate products and enter reviews
    • Screenshot library for each product
  • Basic shopping functionality
    • On any of the product pages, add the product to the basket
    • Products may be pre-release and so instead offer a “register your interest” option.
    • Shopping cart view
    • Check out via swreg.com or similar.

All in all, this is a pretty simple site but touches on all the key areas of development with Orchard. The look and feel of the site is as per the following mock up (click for a larger view);


Up next
So that’s the stage set, up next we’ll get ourselves a copy of orchard and make a start on skinning it to look like the above. I’m not planning on covering how to use orchard to manage your site in any of these posts by the way, this will purely be technical content which I’m hoping to write in a recipe style so you can both follow along with the series or use each article as a reference for how to achieve a particular goal.


  1. Good post. Orchard is the next CMS king.

  2. Tony - Did you use Orchard for this blog?

  3. @LaDIOM - no, it's just on blogger.com - Orchard is more than capable of doing this though.

  4. Hi Tony,

    We have a requirement, need to create dynamic websites for different languages. i.e we will create 4 templates for each pages.

    for ex. We have Image, Title, Description and documents in the page, based on the template selection those part position has to change.

    we did not get how to proceed this. Please help us on this scenario.

    Thanks in advance

    Senhil kumar

  5. Hi Senhil,

    Have you taken a look at the documentation on globalising sites here : http://docs.orchardproject.net/Documentation/Creating-global-ready-applications ?

    There is a section at the bottom about having translated content and how best to handle it.


    1. Hi Tony,

      Thank for your quick reply.

      I think i had confused you bit. I will explain my exact scenario:

      We have to provide facility to create dynamic micro-sites to the customer. Here, we just want to render data in the appropriate place in the view.
      We want use Orchard CMS to create only page template. We will fetch data from our database and bind it in the appropriate content part.

      Only to create template customer will use orchard CMS website.

      Also, we have to change content parts(image, title, desc...) through Themes. Not getting how to apply themes for content part.

      Please help us.

      Thank you,

    2. Hi Tony,

      Do you have any idea in this requirement? Please update.

    3. I still don't think I'm following you - applying themes for a content part?

      What I think you're actually wanting is the ability to have a different theme in different areas of your orchard site? Each micro-site within orchard having it's own theme?

      If that's the case, I'm sure it's possible, but I don't have the answer on how off the top of my head. Have you tried the discussion boards on codeplex?


  6. Hi Tony,

    Yes, you are correct. Our requirement is not only applying themes to each micro-sites (This we can achieve through multi-tenant) we have to change layout of parts in the pages.

    If we are using different content types we can apply themes to change layouts/positions, but we will be having parts(image, title, descriptions..), need to change layouts for each microsites.

    I will post these questions in the codeplex also, If you have any idea please share with us.

    Thank you very much for your post and support.

    Thank you,


  7. Hi. Frankly haven't completed the entire article yet. But whatever i read till time have cleared a lot of my questions regarding custom development in Orchard. I have some queries if you can reply it will be a great help to me.

    1. Does you have any Orchard database schema information document which give me information like how a page is mapped into which tables and fields in database.

    2. Sometime it is quite hard to create all the pages from UI/ admin page and you look some kind of shortcut way to create pages right from database or some other way may be using some kind of script. Does any such method available for Orchard too.

    Thanks again for such nice article and help.