Develop websites with new themes and modules set up dev

Topics: Customizing Orchard, Installing Orchard, Writing modules, Writing themes
Nov 7, 2011 at 10:15 AM
Edited Nov 7, 2011 at 10:17 AM


I am new to orchard and must say i think it is really good, for a number of reasons, 1 of which for me is to learn from and another its a great CMS. I hasve been spending alot of time looking at the code, reading the documentation and  also looking at blogs, posts online to get a better understanding of it. I have also got the full source and a webmatrix download version i have pelayed with both.

Now onto my question:

What i wish to do is: craete multiple websites which are all seperate to each other, therefore will have their own database's. Each will have their own theme created by me and very possibly some of them will have a new module or 2 created by me to fulfill their needs. I will not be changing any of the orchard source as i dont need to for creating themese and modules. So what is the best way to set up the development for lets say 4 websites. I see in posts you should use the full source code but does that really mean i should download the complete source with the 60+ projects in a solution then copy and paste it four times (1 for each website) as that seems very much like overkill especially as i dont want or need to change any code that has not already been compiled, although i would like to be able to debug my own modules, themes. In some posts/ blogs such as: and others they have said to download the source and use orchard.exe to create the new theme or module then add it to your solution but that would then make the solution have 61+ projects where i only really need orchard.web and mynewtheme in a solution but then when i try i get 100's of compile issues (i know you will i hear you say but how can i overcome this). The below image was taken from the link above and shows how he has set up the solution with 2 projects but i cant seem to do this can someone please help i have spent days tring to get things set up.

How do you set up your enviroment to create new websites? The documentation says you can you use webmatrix to download orchard from and open the project in VS from the ribbon link but in the version i get downloaded there is no project file it just opens as a website and then wont compile due to references etc (again i know i hear you say this is how it is supposed to work.) So can someone pelase shed some light on how i can create multiple websites and create unique themese and modules for them in visual studio and hopefully without the need for the complete source and only the .web project.

fig 1 image  


thanks Jon 

ps. sorry for the long post.

Nov 7, 2011 at 11:43 AM

The Multitenancy feature will allow you to run multiple websites with separate databases from one instance of Orchard. You might want to configure your hosts file to imitate multiple domains all on localhost.

It's easiest to just use the solution you've been given. It's handy to be able to step into Orchard source as well as using VS features like "Find All References" etc.

You should never change any code in Orchard or even in third party modules (it'll get overwritten when you upgrade). Instead you can supply code in your own module and use the OrchardSuppressDependency attribute to replace implementations when necessary.

Nov 7, 2011 at 11:59 AM

Thankyou for your reply. I have not tried that so will do.

A few things:

I use the source to set up domain 1 and say i use sql server for for it
Then i know want to set up domain2 so  i go into tennants in the admin section and set it up as decribed (

Know i should have domain1.devweb and domain2.devweb all installed in the same folder > orchard > src > orchard.web. Is that correct? If so do domain1 and domain2 get to see all modules/ thmes in the shared themes and modules folders.
If yest to all above how do you go about delivering each domain to production/ live site independandlty without redundant themese and modules etc.

Is multitennancy really the best way to go as you could end up with lets say you do 20 orchard sites it would get confusing and 20 extra themes and modules in the shared folders is alot. Just my thoughts. Is this how you do it?


Thanks Jonathan

Nov 7, 2011 at 12:15 PM

Well the idea is to write modules in such a way that they have useful features that could be used on more than one site. Obviously sometimes a site will have specific requirements that won't be used anywhere else so that will go in a specific module for that site. But having lots of modules isn't a huge problem if those features aren't enabled on the tenant. Similarly with themes, only active themes actually do anything. I find it's much easier to only have to upgrade a module once, rather than on several different sites.

The idea on a production server is that you add additional bindings to the website in IIS. So it's the same IIS website, it's just serving multiple domains (and Orchard will use the domain of the incoming request to determine which shell should respond).

Nov 7, 2011 at 12:19 PM

Thanks again.

I agree about modules being built to accomodate other where possible and that its easier to update once in one place.

Sorry i should of been more specific about production > sometimes clients would want to host at different places (thats why i wanted seperate databases) so how would you go about packagine them for production as they would have information on other sites in the app_data folder.

Thanks again.

Nov 7, 2011 at 1:01 PM

You can use a recipe to define features and themes for a website to download and install, this is one way of replicating your site on a production server. But basically, just install Orchard and then install the modules you need. You don't have to upload everything; I don't really see the problem?

Nov 7, 2011 at 1:19 PM

Again thankyou.

I understand you can use recipies and only install the modules you require. I am only thinking as an example i have 5 websites set up in mulitennancy in developement as you stated this is the best approach. Now they are all finished (not really havent even started ;-) ) and i have have to publish to 5 different hosts, normally you would install each sites db then go and ftp each site to their host and edit the web.config for db access. However with multitennacy in dev how can this be achieved i get the fact i can have a db per site so thats sorted, but the files in the orchard.web now thats the issue as there are so many sites now in the app_data folder and lots of modules, themese and i only want each one to have it relivant files etc. I know i could write down which site uses which module, theme and mess around ftping only relivant folders but again what about the app_data folder all sounds confusing.

Setting up each site seperately in production from scratch seems a waste of time as i have the sites as i want them in dev and just want to copy them over.

Thanks for your help i do appreciate it, Sorry to keep on just trying to get the best picture before commentcing and then getting in a mess. Always good to hear how others achieve things in my opinion


Nov 7, 2011 at 1:46 PM

No worries; it's good to get these things worked out in advance.

Well, when I set up a production site I just start with a clean install of Orchard. If I have a lot of complicated configuration and data population to replicate, I use a recipe.

There's nothing stopping you replicating the database of course; the only files you need from App_Data is the specific folder for your tenant (most of the files there are auto-generated when Orchard starts).

But, there's no other way to keep track of which modules a tenant uses in order to automatically upload the right ones. I'd just upload them all if you don't want to keep track manually.

Nov 7, 2011 at 6:12 PM

I do things a little differently. For each site, I clone the Orchard repository, copy the solution file to one that is specific to te project (and that I won't have to merge all the time), and create subrepos for additional themes and modules that I use. For that last part, I clone the module or theme's repo into the site, which enables me to maintain my module set in a single place but still be able to deploy updates and do local changes that I can then push up. It does take more disk space but I find it cleaner.

Nov 8, 2011 at 8:09 AM

Thankyou both for your replies. I tried to reply last night via an ipad but the save button did nothing :-)

bert i am not 100% sure what you mean by clone repository (copy complete source from codeplex; correct?) and copy the solution file (why just the file can you explain this a bit more pelase)

I am not sure which way to go now, but at least i now, know 2 ways are possible and probably more. I will do the first sight and see which is best for me.


Nov 8, 2011 at 6:23 PM

The Orchard source code is under Mercurial, which is a distributed version control system. Cloning the repository is explained here:

I'm also making a copy of the solution file within that cloned repository's directory, so that I can make changes to the organization of my specific web site without fear of updates to the source from the main repository overwriting my changes to that file.

Nov 11, 2011 at 10:24 AM

Thanks bertandleroy. I will browse the solution file as see what changes need to be made in line with you comments. Does anyone on here create themes or modules for selling, only i made need help with both and would look at paying for it to get them done quicker (if so anny idea how much people would charge for a theme module i know is more dependant of complexity). Please email me if you are interested.