Multiple websites, multiple codebases shared page templates


We are looking to develop multiple websites, under an Enterprise license, to share content (via a common EPiServer database and document libraries) and page templates.  What I am struggling to get my head around is how to achieve this when the individual sites are being developed independantly through VS2008 and potentially installed in different web folders in IIS.  This is to allow different deployment dates and to ease maintainance.

The main area of concern is the use of page templates.  There will be cases where common page templates will be used across multiple sites.  Are there any alternatives to having the page templates code duplicated between all of the web applications in the VS projects?

Mar 03, 2011 16:28

There are alternatives, but not easy ones.

Put the codebehind files/base classes in a common library assembly. Keep only the aspx/ascx files in each website. This still requires duplicating those files though. And autogenerating controls' fields in the codebehind might be hard/impossible to acheive, so you'll have to declare them yourself.

You could also stick the aspx/ascx:es in a different project, and modify the build process to include those files when you build or publish the application. Again, you'll lose some of the automagics (like recognizing content placeholders from the masterpage).

Or you can create Webcontrols instead of Usercontrols, which whill be a lot more work, but will enable you to stick the controls in an assembly. Again, you'll have to duplicate the aspx:es, but if you keep all code in the controls that shouldn't be to much of a drawback. The big drawback here is really the longer development time and that you can't deploy design changes in controls without the site restarting (since you'll be deploying a dll instead of an ascx).

I'm sure there are other ways as well, but AFAIK no really good solutions.

Edit: Typo

Edited, Mar 04, 2011 10:14

An alternative is to have the aspx, ascx etc in a common location and use a VirtualPathProvider to map them in to the application. Like EPiServer does with the system pages (edit, admin etc.).

Mar 04, 2011 10:27

Thanks for your replies.  I had started to look at the VPP approach but had problems with it.  However, since Johan has suggested this, I will stick with it a bit longer.

Mar 04, 2011 14:33
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.