AI agents: the content index is at /llms.txt. Every page is also available as Markdown — send the request header Accept: text/markdown, or append .md to the page URL.
Xperience Docs

Cookie consent

We use necessary cookies (opens in a new tab) to run our website and improve your experience while browsing. Additional cookies are only used with your consent. You may revoke your consent on the Cookies Policy (opens in a new tab) page or in your browser at any time.

Configure (opens in a new tab)
  • Documentation
    InstallationUsing the Xperience interfaceDeveloping websitesConfiguring XperienceManaging usersSecuring websitesDeploying websitesManaging website contentMultilingual websitesMacro expressionsExternal utilitiesIntegrating 3rd party systemsCustom developmentE-commerce featuresOn-line marketing featuresRelease notes - Xperience 13Xperience terminology glossary
  • Tutorial
    Using the Xperience interfaceDeveloper tutorialBusiness tutorialResource hub for marketers
  • API Examples
    ConfigurationContent managementDevelopmentE-commerceOn-line marketingSocial media
  1. Home
  2. Configuration
  3. Settings

Settings


Was this page helpful?

Send us feedback Go back to top
  • Community Questions & Answers (opens in a new tab)
  • Contact support (opens in a new tab)

List of examples:

  • Getting the values of settings
  • Getting the values of web.config keys
  • Setting values for settings

Getting the values of settings

C#
// Note: To find the code names of setting keys, open the Modules application in Xperience, edit a module and view the Settings tab

// Gets the value of the "Page not found URL" setting for the current site
string pageNotFoundUrl = SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".CMSPageNotFoundUrl");

// Gets the global value of the "Scheduled tasks enabled" setting 
bool scheduledTasksEnabled = SettingsKeyInfoProvider.GetBoolValue("CMSSchedulerTasksEnabled");

// Gets the value of the "Application scheduler interval" setting for the current site
int schedulerInterval = SettingsKeyInfoProvider.GetIntValue(SiteContext.CurrentSiteName + ".CMSSchedulerInterval");
> Back to list of examples

Getting the values of web.config keys

C#
// Gets the value of the "CMSApplicationName" key from the appSettings section of the web.config
string webConfigSetting = ValidationHelper.GetString(SettingsHelper.AppSettings["CMSApplicationName"], "");
> Back to list of examples

Setting values for settings

C#
// Sets the value of the "Page not found URL" setting to "~/System-pages/NotFound" for the current site
SettingsKeyInfoProvider.SetValue("CMSPageNotFoundUrl", SiteContext.CurrentSiteName, "~/System-pages/NotFound");

// Sets the value of the global "Scheduled tasks enabled" setting to false
SettingsKeyInfoProvider.SetGlobalValue("CMSSchedulerTasksEnabled", false);

// Sets the value of the "Application scheduler interval" setting to 30 for the current site
SettingsKeyInfoProvider.SetValue("CMSSchedulerInterval", SiteContext.CurrentSiteName, 30);
> Back to list of examples