Orchard beside MVC

Topics: General
Apr 5, 2011 at 12:17 PM

Hi there

Can anyone tell me if I can have an Orchard CMS sit alongside my own code within my web application.

So Orchard would be looking after the information/brochure pages within the site and the ecommerce functionality that I've created would be able to run alongside.

Thanks

BG

Apr 5, 2011 at 1:11 PM

Orchard is an MVC app. When you write modules for it, behind the scenes they are just MVC areas. So yes it's very easy to do, you can put all your ecommerce bits into their own module and then set up routing however you need.

Apr 5, 2011 at 1:25 PM
Edited Apr 5, 2011 at 1:25 PM

Hi Pete

Thanks for your reply. I just had a look at some of the introductory documentation on "Modules".

My current ecommerce system actually sits in its own area already but uses MVC2 and gets it styling from a plain ol' Master Page.

Would I have to tie myself in into upgrading everything to MVC3/Razr and then using themes. Or can my ecommerce area sit outside all of that?

BG

Apr 5, 2011 at 1:52 PM

Orchard still support "old school" aspx / ascx templates alongside Razor. You can see this particularly when it can't find a certain partial view, it displays a list of all the alternate filenames it looked for and it always includes .ascx versions as well as .cshtml and .vbhtml.

Additionally if you just omit the [Themed] attribute from your Controller / Actions and return a normal View(...) result instead of a ShapeResult then all the Orchard templating bits should get completely bypassed.

So I don't think there's really any upgrading to do. When you add new views you can use Razor (and believe me it's worth learning it - there are things you can do with it that are simply not possible in aspx; for instance template delegates which are like mini template functions - quite apart from it just looking and feeling way nicer) - but all your aspx/ascx bits will continue working as normal.