Settings Panel
The Settings panel at /lean_cms/settings is for site-wide values that aren’t tied to a specific page section — contact information, business hours, feature toggles, and CMS behavior.
Accessing settings
Admin users can access Settings from the CMS navigation. Editor users with the appropriate permission can also access it.
Settings are stored in the lean_cms_settings table as key-value pairs and cached with SolidCache for one hour.
In your views
Use cms_settings_section to wrap settings-backed content with an edit overlay. The overlay button links to the Settings admin page instead of a page content editor:
<%= cms_settings_section(display_title: 'Contact Information', anchor: 'site-info') do %>
<div class="contact-info">
<p><%= LeanCms::Setting.site_phone %></p>
<p><%= LeanCms::Setting.site_email %></p>
<address><%= LeanCms::Setting.site_address %></address>
</div>
<% end %>
Feature toggles
These settings control CMS behavior and can be toggled without a redeploy:
| Setting key | Default | Description |
|---|---|---|
in_context_editing |
"true" |
Show edit overlays for logged-in CMS users |
content_locked |
"false" |
Block all CMS writes (set during content sync) |
Toggle from code:
LeanCms::Setting.set('in_context_editing', 'false')
LeanCms::Setting.set('in_context_editing', 'true')
Reading settings in views or controllers
# Simple get with fallback default
LeanCms::Setting.get('site_phone', 'Not set')
# Boolean check
LeanCms::Setting.enabled?('in_context_editing')
# Convenience methods
LeanCms::Setting.site_phone
LeanCms::Setting.site_email
LeanCms::Setting.site_address # Multi-line string
LeanCms::Setting.site_address_single_line
LeanCms::Setting.business_hours # Returns hash: { 'hours' => [...], 'note' => '' }
See the full Settings Reference for all available keys.