Site Clusters – Part 2 – Getting Started

In part 1, we described some basics about cultures in .NET and we introduced the concept of a Site Cluster. To recap – a Site Cluster is a simple way to create multiple websites that share a single content tree. Keep in mind, this is ONE localization strategy among many, and it works and is effective only under certain circumstances, which we will list.

To create a Site Cluster is simple – create a set of pages in Sitecore like you normally would, then define two site definitions that both “point to” the same home node. In the site definition, you might specify a different primary language (or not)…including using virtualFolder / physicalFolder to allow the sites to share the same targetHostName…but now you have two sites sharing a tree – a Site Cluster. Within a Site Cluster you can have different sites that are also sharing the same languages (we talked about that more in part 1, and we’ll continue throughout the series).

Let’s take a look at some sample Site Definitions for my BrainJuice website. Here’s my usecase: I am building two clusters – one for North America with 3 websites:

Site Target URL Primary Culture Secondary Culture(s)
US http://www.brainjuice.com US English (en-US) US Spanish (es-US)
Canada http://www.brainjuice.ca Canadian English (en-CA) Canadian French (fr-CA)
Mexico http://www.brainjuice.com/mexico Mexican Spanish (es-MX) Mexican English (en-MX)

…and yes, we could use www.brainjuice.mx for Mexico, but I wanted to show an example of virtualFolder / physicalFolder as well 🙂
and another for Europe also with 3 websites:

Site Target URL Primary Culture Secondary Culture(s)
France http://www.brainjuice.fr France French (fr-FR)
Germany http://www.brainjuice.de Germany German (de-DE)
Belgium http://www.brainjuice.be Belgian Dutch (nl-BE) Belgian French (fr-BE) and
Germany German (de-DE)

Please note, two of my sites share a language – Germany and Belgium are in the same cluster, and they share de-DE as a culture. Why? Well, that’s because there is no culture for Belgium German, but German IS spoken in Belgium (see part 1 of this series for more in depth). We’ll be discussing the impact of this throughout the series.

So first, here’s a picture of my content tree:

North America and Europe

2 site clusters content tree snapshot

Next, let’s take a look at the site definitions (simplified):


<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <sites>

      <!-- North American Cluster -->

      <site patch:before="site[@name='website']" 
              name="BrainJuiceUS" 
              hostName="www.brainjuice.com|brainjuice.com" 
              targetHostName="www.brainjuice.com" 
              rootPath="/sitecore/content/BrainJuice/BrainJuice Market Sites/North America" 
              startItem="/home" 
              virtualFolder="/" 
              physicalFolder="/" 
              XMLSitemapFilename="brainjuiceus-sitemap.xml" 
              database="web" 
              domain="usa" 
              language="en-US" 
              secondaryLanguages="es-US" />

      <site patch:before="site[@name='website']" 
              name="BrainJuiceCA" 
              hostName="www.brainjuice.ca|brainjuice.ca" 
              targetHostName="www.brainjuice.ca" 
              rootPath="/sitecore/content/BrainJuice/BrainJuice Market Sites/North America" 
              startItem="/home" 
              virtualFolder="/" 
              physicalFolder="/" 
              database="web" 
              domain="canada" 
              language="en-CA" 
              XMLSitemapFilename="brainjuiceca-sitemap.xml" 
              secondaryLanguages="fr-CA" />

      <site patch:before="site[@name='BrainJuiceUS']" 
              name="BrainJuiceMX" 
              hostName="www.brainjuice.com|brainjuice.com" 
              targetHostName="www.brainjuice.com" 
              rootPath="/sitecore/content/BrainJuice/BrainJuice Market Sites/North America" 
              startItem="/home" 
              virtualFolder="/mexico" 
              physicalFolder="/mexico" 
              database="web" 
              domain="mexico" 
              language="es-MX" 
              XMLSitemapFilename="brainjocksmx-sitemap.xml" 
              secondaryLanguages="en-MX" />

      <!-- European Cluster -->

      <site patch:before="site[@name='website']" 
              name="BrainJuiceFR" 
              hostName="www.brainjuice.fr|brainjuice.fr" 
              targetHostName="www.brainjuice.fr" 
              rootPath="/sitecore/content/BrainJuice/BrainJuice Market Sites/Europe" 
              startItem="/home" 
              virtualFolder="/" 
              physicalFolder="/" 
              database="web" 
              domain="france" 
              language="fr-FR" 
              XMLSitemapFilename="brainjocksfr-sitemap.xml" />

       <site patch:before="site[@name='website']" 
              name="BrainJuiceDE" 
              hostName="www.brainjuice.de|brainjuice.de" 
              targetHostName="www.brainjuice.de" 
              rootPath="/sitecore/content/BrainJuice/BrainJuice Market Sites/Europe" 
              startItem="/home" 
              virtualFolder="/" 
              physicalFolder="/" 
              database="web" 
              domain="germany" 
              language="de-DE" 
              XMLSitemapFilename="brainjocksde-sitemap.xml" />

       <site patch:before="site[@name='website']" 
              name="BrainJuiceBE" 
              hostName="www.brainjuice.be|brainjuice.be" 
              targetHostName="www.brainjuice.be" 
              rootPath="/sitecore/content/BrainJuice/BrainJuice Market Sites/Europe" 
              startItem="/home" 
              virtualFolder="/" 
              physicalFolder="/" 
              database="web" 
              domain="belgium" 
              language="nl-BE" 
              XMLSitemapFilename="brainjocksbe-sitemap.xml" 
              secondaryLanguages="nl-FR|de-DE" />
    </sites>
  </sitecore>
</configuration>
</xml>

For the Mexico site, because it is using a virtualFolder, it must be patched in before the US site which shares its hostname.

Some Limitations and Requirements of a Site Cluster

Before we go down this road, let’s talk about some basic limitations we must live with in order to use a Site Cluster.

  1. Shared Content
  2. Shared I/A / Content Architecture
  3. SEO
  4. Shared Administration

Shared Content

The first and most obvious requirement is that most of the content within the website is meant to be shared to the others. If this isn’t the case, why use a Site Cluster in the first place?

Shared I/A and Content Architecture

Ditto – remember that you aren’t just sharing blocks of content; you are actually sharing pages. So the URL structure of the sites in the cluster will be the same. You can translate the URLs by using DisplayName, but they will have the same structure. Later on, we will cover the need for some sites to “vary” from the others by removing sections of the tree.

SEO

If you have this much shared content and shared pages, you have to deal with some SEO problems – like assigning canonical tags to make sure tenants aren’t improperly penalized for the duplicated content. Also, we need to generate things like XML sitemaps (which also might be multi-lingual).

Shared Administration

Finally, if you have 2 sites that are sharing a page in the same language, you can’t “protect” one site’s usage of the page from another with a Site Cluster (you can with clones, but ew).

That’s all for today. In the next post in this series, we will start to discuss some of the problems we must overcome – especially when using a shared library of components with a Site Cluster, and how to use facilities in Sitecore such as personalization and an overloaded Item Provider to solve those problems. Stay tuned for part 3.

Brian Beckham

I am the President and CEO of BrainJocks. As a Sitecore MVP, I spend most of my time consulting and architecting software solutions for enterprise-level Sitecore projects.

Learn more about Brian.

Add a Comment

Your email address will not be published. Required fields are marked *

Or request call back