Site-specific taxonomies

Taxonomies are supported in multisite mode. You can customize the taxonomy per site, for example, you can set different categories for different sites, while using the same taxonomy.

When a taxonomy is set to be used on a specific site only, all existing relations between the taxa and their content items are removed and a new set of taxa is created for the specific site only.

NOTE: The original taxa are still available and visible on all other sites.

The code sample below shows how to set Categories to be used on a specific site and how to duplicate the items from one site to another, based on specific rules. In this example, the Categories taxonomy is set to be specific for Site 2. After that, only the food category and its children are copied from Site 1 to Site 2.
Once the Categories taxonomy is set to be specific for Site 2, it is shared with Site 3, so that all taxonomy items get shared and synced between both sites. Use the following code sample:

 

To retrieve taxonomies used in a specific site, the TaxonomyManager method GetSiteTaxonomy resolves the correct taxonomy instance of a site. If no site is specified, the site from the current context is used.
In order to get the specific taxonomy used in Site 3, the sample above passes to the method the Categories taxonomy, obtained by name, and the ID of Site 3. In this scenario, the ID of the resolved Categories taxonomy for Site 2 and Site 3 is the same, since they share this taxonomy.
If you retrieve Categories taxonomy for Site 1, it will be the same one that you have specified as argument, because it has never been set to be specific for Site 1.

The above scenario is explained by the following chart:
multisite_taxonomies

Was this article helpful?

Next article

Delete taxonomies