Site-specific settings

Overview

Each Sitefinity CMS instance has a default configurations set. Each site that belongs to this instance can have its own, site-specific settings. To do this, you need to break the inheritance from the default configurations and create site-specific settings. 

The default configurations are saved on the file system. They cannot be changed during runtime. Out of the default configurations, you can create site-specific settings. These settings are saved in the database. They can be changed runtime. Once you create site-specific configurations, they become settings.

PREREQUISITES: To create site-specific settings, your Sitefinity CMS instance must be in auto-storage mode of the configurations. For more information, see Auto-storage mode of configurations.

Site-specific settings and continuous delivery

You create site-specific settings on your Production environment.
The sites from a Sitefinity CMS multisite instance are considered content and are part of the database. The site-specific settings are bound to the database and are, by definition, application settings.

If you have configured Sitefinity CMS in continuous delivery, site-specific settings cannot be part of the continuous delivery process, because they belong to the database.

Unless a site is configured by deployment, you create and modify its settings on the Production environment.

Configure by deployment

If you have set your sites to be configured by deployment packages via the continuous delivery process, you cannot create site-specific settings on the next environment.
For more information, see Deployment mode of websites.

IMPORTANT: When using config transformations from web.config appSettings section, you lose the ability to edit those configurations per site.

Limitations

  • When you create site-specific settings, you can expect them to apply only to newly developed functionality. Existing customizations and out-of-the-box features do not respect and apply the new site settings automatically.
  • The out-of-the-box Sitefinity configurations do not support AllowPerSite setting, if enabled.

Exceptions

The following properties cannot be made site-specific:
  • ConfigElement properties marked as key properties.
    For example, [ConfigurationProperty("background", IsKey = true)] cannot persist site-specific values.
  • SiteSettings config
    SiteSettings config applies to all sites.
  • Sitemap configs cannot have site-specific properties defined. 
    Sitemap config has its own internal logic of handling different site settings.
  • ConfigElement parameters collection of type NameValueCollection are not supported.

Procedure

To create site-specific settings, on your production environment, perform the following:

  1. Navigate to Administration » Settings » Advanced.
  2. Locate the property that you want to make site-specific.
    This property will have different values for the site that you choose.
  3. Click its question mark.
  4. Copy the value that is displayed in the tooltip.
  5. In the tree on the right, expand SiteSettingsConfig and click SiteSpecificProperties
  6. Click Create new.
  7. In Path, enter the copied value.
  8. Save your changes.
  9. Restart your application.
  10. Navigate again to Administration » Settings » Advanced.
  11. Locate the property that you want to make site-specific.
  12. Use the site selector to choose the site for which you want to have a different value.
  13. Click Break inheritance.
  14. Enter the new value of the property and save your changes.

RECOMMENDATION: When reading site-specific settings, we recommend using Config.Get<DummyConfig>(). It will respect the current site context and load any site-specific values for it. It also caches the configuration and increases performance. We do not recommend using ConfigManager.GetManager().GetSection<DummyConfig>(), because it does not load site-specific values and does not cache the loaded configurations.

To work with site-specific settings with the native API, use the following code sample:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?

Next article

Site-specific users