Search code examples
sitecoreglass-mappersitecore-mvctdssitecore8.1

How to set up Sitecore 8.1 MVC project with multiple website


I am planning to set up a Sitecore 8.1 MVC project for 2 website in one visual studio solution so which approach should I follow:

Approach 1:

Should I create two MVC project in one solution

Sample.SC.Model ( C# class library )

Sample.SC.Utility ( C# class library )

Sample.SC.Web.Website1 ( MVC project ) ( This project will contains layout,sublayout and everything specific to Website1 )

Sample.SC.Web.Website2 ( MVC project ) ( This project will contains layout,sublayout and everything specific to Website2 )

Aproach 2:

Should I create only one MVC project and put the Website1 layout and Website1 sublayout in Website1 folder and Website2 layout and Website2 sublayout in Website2 folder

Sample.SC.Model ( C# class library )

Sample.SC.Utility ( C# class library )

Sample.SC.Web.Website ( MVC project )

****Folder structure under Sample.SC.Web.Website node****

Layout

Website1 ( will contains layout specific to Website1 )

Website2 ( will contains layout specific to Website2 )

Sublayout

Website1 ( will contains sublayout specific to Website1 )

Website2 ( will contains sublayout specific to Website1 )

I am also planning to use GlassMapper and TDS in this project.

Thanks


Solution

  • I think you're looking for a compelling technical reason to choose one approach over the other, but I don't think there is one.

    Ultimately both approaches once deployed will result in a single website. While people have different preferences, both will work.

    Much of it will come down to the similarities and differences between the sites. Are they completely separate and unrelated? If so then you might find option 1 preferable because there will be less clutter per project.

    However, if the two sites will share elements then it might be simpler to manage using option 2.

    I don't think the use of TDS/Glass should really influence your decision either way.