3
votes

If I have 1 Umbraco installation with 4 websites, is it possible to share contents between the sites?

Or is it better to create another website ('repository') that will have all the contents and allow the 4 other websites to retrieve/link contents from this 'repository' website?

2

2 Answers

9
votes

There was a good session at Umbraco CodeGarden by CountryWide this year that might be worth watching as it discussed a group in the housing market that have about "40+ different high traffic sites from a single Umbraco installation" but with shared content between many of the sites in the group. You can watch the video here:

http://stream.umbraco.org/video/9921509/40-different-high-traffic-sites-from-a

I'd recommend watching the entire video but if not you can jump to about 25 minutes in to see this topic of discussion. They have a shared content node (+ children).

Simon

1
votes

I would recommend you stick with your existing websites and not create a repository website. This makes it easier I think to define canonical urls for documents if they are to be displayed on multiple websites. Also makes more sens from a content editor point of view. To reach content from another website, I would use code similar to this (considering Umbraco 7+ here):

// Root nodes
var root = Umbraco.TypedContentAtRoot().First();
var site = Model.Content.AncestorOrSelf("Site");
var lang = Model.Content.AncestorOrSelf("LanguageHome");

var allOtherWebsites = root.Children.Where(x => x.Id != site.Id);
var newsFromAllOtherWebsites = allOtherWebsites.Descendants("News").Where(x => x.Parent.Name.ToLowerInvariant() == lang.Name.ToLowerInvariant());

// Do things with news...

I threw in something for multi-lingual setup also, you can simply remove those if you don't need.

Hope this helps!