LogoLogo
SourceSupportTraining
v6.x
v6.x
  • Introduction
    • Contributing Guide
    • Release History
      • 6.1.0
      • 6.0.5
      • 6.0.4
      • 6.0.3
      • 6.0.0
      • Upgrading From v5.x
    • About This Book
      • Author
  • Getting Started
    • Installation
      • System Requirements
      • *CommandBox Installation
      • Source Installation
      • Existing ColdBox Application
      • Docker
    • Updates
  • Usage
    • Using ContentBox
      • The ContentBox Dashboard
        • Home
        • About
      • Content
        • Publish Content
          • Blog
          • Sitemap
          • Content Editing Tips
            • Editor Features
            • Dynamic Variable Output
            • Markdown Support
            • Relocations
            • Scheduled Content
        • Custom Content
          • Content Store
          • Content Templates
          • Categories
          • Media Manager
          • Menu Manager
      • Comments
        • Inbox
        • Settings
      • Look & Feel
        • Active Theme
        • Global HTML
        • Themes
        • Widgets
          • Inserting a Simple Widget
      • Media Manager
      • 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
      • Widgets
        • An Easy Example
        • Inside the Page Editor
    • Developing For ContentBox
  • Front End Development
    • Front End Development
      • File Structure
      • JS and CSS Assets
      • Customizing Views
      • Customizing Layouts
      • Customizing Navigation
      • Global Variables
      • Managing Assets
      • Template Variables
      • The Content Store
    • Theme Development
      • Theme Settings
      • Theme UDFs
      • Theme Templates
      • Theme Layouts
      • Theme Views
      • Theme SEO Functionality
  • Back End Development
    • 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
        • Core Widgets
        • Simple Widget
        • Widgets with Arguments
        • Multiple Render Function Widgets
      • 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 GitHub
Export as PDF
  1. Back End Development
  2. 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 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 2 years ago

Was this helpful?