November Happy Hour will be moved to Thursday December 5th.

Muti site Set up

Vote:
 

We would like to start setting up multiple websites within the same solution and are wanting to follow best practices when doing this.

 We would like to be in a position where we can share blocks, pages etc across the sites but also have elements which are bespoke to each individual site.

Each site would need its own stylesheet ect.

#176785
Mar 27, 2017 10:57
Vote:
 

Is this what you are looking for? http://world.episerver.com/documentation/Items/Developers-Guide/Episerver-CMS/9/Deployment/Setting-up-multiple-sites/ 

I don't believe you will be able to share pages across the websites, since each page will need to have it's own SiteDefinition.

Blocks and media can be shared across websites. When you create blocks and select if you want to create it "For all sites" which means it is globally shareable.

NOTE: if you use the "Create new block" link at the bottom of the content area it creates the block for that page (non shareable). 

For individual stylesheet, I would recommend creating custom properties on each website's start page that defines the stysheet to be used and other custom settings for each site. 

Hope that helps!

#176835
Edited, Mar 28, 2017 21:30
Vote:
 

Thanks for the reply, The cms for creating the site s look great.

I am still however looking for some information on how this may be set up in the code. The best practices for this.

would it be best practice for each indervidual site to have a specific start page type (in visual studio)

The custom propeties sound good, how would i set this up, in the code base?

#176851
Mar 29, 2017 9:47
Vote:
 

I would create one page type for all start pages since all of them will have the same properties (like stylesheet etc.) with different values, unless they are structurally different. I assume that is not the case. Most multi-sites I have seen are similar in layout with minor differences like different theme for each site etc.

Also, you can have one SitePageData class (refer Alloy site) for all properties that are global to all pages (SEO properties etc.) and have all pages inherit from that class.

NOTE: To use the same license for multi-sites all sites must use the same code base.

#176910
Mar 29, 2017 16:58
Vote:
 

with different values - how do you mean, each site would have a seperate style sheet, the sites do not share a style sheet.

I can use all the same models for startPage, header  and footer ect but the views would be different. how could this be achieved?

#176912
Mar 29, 2017 17:12
Vote:
 

It's difficult to architect something without looking at the requirements. What I was saying is each site will have a unique value on the start page in terms of either stylesheet or class name or something that will identify the website and which theme to apply. The assumption I am making here is all sites are structurally the same but vary by styles in terms of colors fonts etc. So with that assumption, the views for blocks/pages will be the same but different styles based on the setting for the site. Makes sense? 

#176913
Mar 29, 2017 17:25
Vote:
 

I understand, as i am rather new to the development of episerver, its quite hard to understand. But i wanted to know the best way to do what you said: "have a unique value on the start page in terms of either stylesheet or class name or something that will identify the website and which theme to apply.".

Some of the Views would be different i believe is this possible?

#176931
Mar 30, 2017 9:52
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.