Brightspot CMS Developer Guide

Site settings


A custom site setting added at the global level is inherited by admin-defined sites, but the setting can be changed only in the global site. When you add a custom setting, you have the option of making the setting available on admin-defined sites as well as the global site. This gives an administrator the ability to override the global setting with a site-specific setting. For example, different sites could have different support contacts; therefore, it makes sense to give site administrators the ability to override the global support setting.

To make site setting fields appear in the UI for all sites (not just Global), specify the target of the modification to SiteSettings.

public class SupportSettings extends Modification<SiteSettings>


To retrieve a site setting, call the SiteSettings#get method, which returns the setting for a specified site, with a fallback to the Global site if the specified site is null. For example, continuing with the SupportSettings code example, the following statement passes the site to SiteSettings#get, as well as the SupportSettings#getUser method. The method is passed as a Function object.

return SiteSettings.get(site, item -> item.as(SupportSettings.class).getUser());

If site is not equal to null, then the setting from the admin-defined site is retrieved; otherwise, the method falls back to the Global setting for user.

Previous Topic
Global-only settings
Next Topic
Multi-site considerations
Was this topic helpful?
Thanks for your feedback.
The elements that get you up and running in a matter of days, from pre-built content types, to modules, to landing pages.

Content types
Modules
Landing pages
Everything you need to manage and administer content within Brightspot CMS, including plug-and-play integrations.

Dashboards
Authoring content
Workflows
Admin configurations
A guide for installing, supporting and administering code on the Brightspot platform, including integrations requiring developer support to use.

Field types
Content modeling
Rich-text elements
Images