LogoLogo
SourceSupportTraining
v3.x
v3.x
  • Introduction
  • Intro
    • Introduction
      • What's New With 3.7.0
      • What's New With 3.6.0
      • What's New With 3.5.0
      • What's New With 3.1.0
      • What's New With 3.0.0
        • Architecture
        • Administrator
        • Themes
        • Front End
        • Upgrading to 3.0.0
      • About This Book
      • Author
  • Getting Started
    • Installation
      • System Requirements
      • CommandBox Installation
      • Source Installation
      • WAR Installation
      • Express Installation
      • Existing ColdBox Application
      • Upgrading ContentBox
      • Docker
    • Quick Guide
  • Usage
    • Using ContentBox
      • Content
        • Publish Content
          • Blog
          • Sitemap
          • Content Editing Tips
            • Editor Features
            • Dynamic Variable Output
            • Markdown Support
            • Scheduled Content
        • Consume Content
          • Content Store
          • Categories
          • Media Manager
          • Menu Manager
      • Comments
        • Inbox
        • Settings
      • Look & Feel
        • Active Theme
        • Global HTML
        • Themes
        • Widgets
          • Inserting a Simple Widget
      • Modules
        • Installing Modules
        • Managing Modules
      • Users
        • Manage
        • Permissions
        • Roles
      • Tools
        • Import
        • Export
        • Static Site Generation
      • System
        • Auth Logs
        • Geek Settings
        • Settings
          • Site Options
          • Admin Options
          • Security Options
          • Login Options
          • Content Options
          • Editor Options
          • Media Manager Options
          • Gravatars
          • Notifications
          • Mail Server
          • Search Options
          • Login Options
        • Security Rules
        • Updates
  • Developing
    • Developing For ContentBox
      • Front-End Development
        • File Structure
        • Theme Development
          • Theme Settings
          • Theme UDFs
          • Theme Templates
          • Theme Layouts
          • Theme Views
          • Theme SEO Functionality
        • The Content Store
        • Customizing Views
        • Customizing Layouts
        • Managing Assets
        • Customizing Navigation
        • Global Variables
        • Template Variables
      • Back-End Development
        • Overriding ContentBox Settings
        • Modules
          • Installing a Module
          • Using a Module
          • Module Locations and Conventions
          • Build a Module
          • Scaffold a Module
          • Theme your Module
          • Build an Admin Module
          • Adding Admin Menus to your Module
          • Adding Meta to your Modules
        • Widgets
          • Simple Widget
          • Widgets with Arguments
          • Multiple Render Function Widgets
        • JS and CSS Assets
        • Interceptors
        • Accessing Logged in User
        • Customizing the Admin
        • Staying on the Upgrade Path
Powered by GitBook
On this page
  • Override ContentBox Settings via ColdBox.cfc
  • Override ContentBox Settings via Java Environment Variables

Was this helpful?

Edit on Git
Export as PDF
  1. Developing
  2. Developing For ContentBox
  3. Back-End Development

Overriding ContentBox Settings

ContentBox allows you to override global site settings dynamically. This approach is great for container based deployments, but also for traditional overrides for testing or staging environments.

Override ContentBox Settings via ColdBox.cfc

You can override any runtime setting for ContentBox via a configuration structure in your main ColdBox.cfc configuration file. This will allow developers to override any runtime setting for any site.

All you need to do is create the a contentbox structure in your configure() or any tier method, with the name of the site (default is the default site) and then any setting name-value pair.

contentbox = {
    // Runtime Settings Override by site slug
    settings = {
        // Default site
        default = {
            "cb_search_adapter"      = "my.search.adapter",
            "cb_media_directoryRoot" = "/docker/mount"
        }
        }
}

Override ContentBox Settings via Java Environment Variables

You can also override any runtime ContentBox setting by passing them via Docker/Java Runtime variables.

Since these are string keys we can now use our fancy structures like the settings above, so you must adhere to our recognition pattern:

contentbox_{site}_{setting}=value

Here is an example on adding a custom media root:

-Dcontentbox_default_cb_media_directoryRoot=./build/docker/contentbox/content

This will allow especially Docker environments to override settings as environments or even provide secrets. More is coming, so stay tuned to our updates.

Last updated 7 years ago

Was this helpful?