I have a working Umbraco project. I have to modify project structures so that it will support multiple sites. What I've done so far:
Back Office:
Created another content node that represents the new site
Set Culture an Hostnames > Domain to local.projectname.net, same for first site with local.otherproject.net
Created new layouts for new content node
Added the domain names to IIS and hosts file
This works fine if the MVC folders from project are in root.
Visual Studio:
-Added my MVC Area 'Site1' and 'Site2' to the umbracoReservedPaths in the Web.config.
-Added the class from below referenced post to register my MVC Area using custom routes:
using System.Web.Mvc;
using Umbraco.Core;
public class MvcStartup : IApplicationEventHandler
{
public void OnApplicationInitialized(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
}
public void OnApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
AreaRegistration.RegisterAllAreas();
}
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
}
}
After this, I get a blank screen on running the project. I followed the steps from this blog post :http://blog.dampee.be/post/2013/03/29/Convert-MVC-application-to-Umbraco-v6-using-Custom-Routes.aspx
Q: What is the best way to structure the project so that will implement multiple sites in Umbraco? I guess the page is blank because Umbraco expects the views to be in root, and now the View folder from root is empty. How can I make Umbraco take the Views from my Areas? Or what have I done wrong so far? Thanks.
Project structure for multi site support
I have a working Umbraco project. I have to modify project structures so that it will support multiple sites. What I've done so far:
Back Office:
This works fine if the MVC folders from project are in root.
Visual Studio:
-Added my MVC Area 'Site1' and 'Site2' to the umbracoReservedPaths in the Web.config.
-Added the class from below referenced post to register my MVC Area using custom routes:
After this, I get a blank screen on running the project. I followed the steps from this blog post :http://blog.dampee.be/post/2013/03/29/Convert-MVC-application-to-Umbraco-v6-using-Custom-Routes.aspx
Q: What is the best way to structure the project so that will implement multiple sites in Umbraco? I guess the page is blank because Umbraco expects the views to be in root, and now the View folder from root is empty. How can I make Umbraco take the Views from my Areas? Or what have I done wrong so far? Thanks.
Hello,
Did you try the "Umbraco" way of MVC? Instead of creating custom routes you let Umbraco handle the routing for you. More info here: http://our.umbraco.org/Documentation/Reference/Mvc/custom-controllers
Jeroen
is working on a reply...