You can configure settings for sites in the Settings application.
There are two basic types of settings:
Note: Some settings are only available as global settings.
Only two types of users can configure settings in the Settings application:
Users without the Global administrator privilege level can only configure setting values for the current site (global-only settings are not available), and cannot access certain security-sensitive settings.
There is a very large number of settings in Xperience. To find a particular setting among all the categories:
In the Settings application, select the root of the settings tree (Settings).
Type the name of the setting or related words into the field at the top of the page.
Click Search.
The page displays all settings that contain the search text in their name. You can edit the values of the settings directly.
Users with the Global administrator privilege level can reset settings to their default values:
All settings in the given category now have the default value defined in the Default value property of the corresponding keys.
Users with the Global administrator privilege level can export the values of all settings in the selected category to a text file. Click Export these settings in the header of the setting page. Exporting settings can be useful, for example when consulting issues with Kentico support.
The Xperience API allows you to check the values of settings in your code. You can load values of both the default and custom settings.
To load the values of settings, use ISettingsService (we recommend using dependency injection to instantiate system service classes). The service exposes an indexer that you can use to access the values of individual setting keys. Settings are identified by the following formats:
ISiteService.CurrentSite.SiteName)using CMS.Core;
...
// Contains an instance of the settings service (e.g., obtained using dependency injection)
private readonly ISettingsService settingsService;
// Gets the value of the 'CMSHomePagePath' setting for the 'SiteCodeName' site
string value = settingsService["SiteCodeName.CMSHomePagePath"];The service always returns string values. If you need to cast the setting value to a different type, use IConversionService.
using CMS.Core;
...
// Contains an instance of the conversion service (e.g., obtained using dependency injection)
private readonly IConversionService conversionService;
// Gets the maximum allowed number of events stored by the event log
int eventLogSize = conversionService.GetInteger(settingsService["SiteCodeName.CMSLogSize"], -1);
// Checks if Continuous Integration is enabled
bool continuousIntegrationEnabled = conversionService.GetBoolean(settingsService["CMSEnableCI"], false);Note: Only users with the Global administrator privilege level can create macros that load the values of settings. The Configure settings permission for the CMS module is not sufficient for this purpose.
Macro expressions allow you to:
You can load values of both the default and custom settings.
Use the following expression to get setting values inside macros: Settings.<settings key code name>
For example:
{% Settings.CMSStoreFilesInFileSystem %}The macro returns the setting's value for the currently running site (or the global value for global-only settings). If you need to access the global value of a setting, you can use the following macro expression: GlobalObjects.SettingsKeys.<settings key code name>.KeyValue