๐Ÿ”ท Core

contentbox-boxlang-overview

Use this skill when understanding ContentBox architecture, core modules, service layer, multi-site behavior, security foundations, and the recommended extension points for building or maintaining ContentBox solutions.

$ npx skills add coldbox/skills/contentbox-boxlang/overview
$ coldbox ai skills install coldbox/skills/contentbox-boxlang/overview
๐Ÿ”— https://skills.boxlang.io/skills/raw/coldbox/skills/contentbox-boxlang~overview

ContentBox CMS Overview (BoxLang)

ContentBox is a professional open-source hybrid modular CMS (Content Management System) built on ColdBox. It supports both traditional CMS and headless architectures, running on CFML engines (Lucee, Adobe ColdFusion) and BoxLang.

Architecture

ContentBox follows a layered modular architecture:

/ (Root App)                    โ† Host ColdBox application, local dev shell
โ”œโ”€โ”€ modules/contentbox/         โ† Core ContentBox engine
โ”‚   โ”œโ”€โ”€ ModuleConfig.cfc        โ† Core module configuration
โ”‚   โ”œโ”€โ”€ models/                 โ† Domain entities and services
โ”‚   โ”œโ”€โ”€ widgets/                โ† Core widgets (19 built-in)
โ”‚   โ”œโ”€โ”€ themes/default/         โ† Default theme
โ”‚   โ”œโ”€โ”€ migrations/             โ† Database migrations
โ”‚   โ””โ”€โ”€ modules/                โ† Sub-modules
โ”‚       โ”œโ”€โ”€ contentbox-admin/   โ† Admin interface (entry: cbadmin)
โ”‚       โ”œโ”€โ”€ contentbox-api/     โ† REST API (v1)
โ”‚       โ”œโ”€โ”€ contentbox-ui/      โ† Public-facing UI
โ”‚       โ””โ”€โ”€ contentbox-deps/    โ† Dependencies (cborm, etc.)
โ”œโ”€โ”€ modules_app/contentbox-custom/  โ† Customization layer
โ”‚   โ”œโ”€โ”€ _themes/                โ† Custom user themes
โ”‚   โ”œโ”€โ”€ _widgets/               โ† Custom user widgets
โ”‚   โ”œโ”€โ”€ _modules/               โ† Custom user modules
โ”‚   โ””โ”€โ”€ _content/               โ† Custom content
โ””โ”€โ”€ modules/                    โ† Standalone ColdBox modules

Key Concepts

Hybrid CMS

ContentBox is both a traditional CMS and a headless CMS:

  • Traditional: Full admin UI, theme system, widget rendering, page/entry management
  • Headless: REST API (v1) with JWT authentication for decoupled frontends

Modular Design

Everything in ContentBox is a module:

  • Core functionality is in modules/contentbox/
  • Admin, API, and UI are separate sub-modules
  • Custom code goes in modules_app/contentbox-custom/
  • Third-party modules go in modules/

ORM & Database

  • Uses CFML ORM (Hibernate) with this.ormEnabled = true in Application.cfc
  • Database migrations via cfmigrations
  • Entities extend BaseEntity with UUID primary keys
  • Soft deletes with isDeleted flag

Multi-Site Support

  • Multiple sites from a single installation
  • Domain-based site resolution
  • Site-specific content, themes, settings, menus

Security

  • cbSecurity for RBAC (Role-Based Access Control)
  • Database-driven security rules
  • BCrypt password hashing
  • Two-factor authentication (pluggable providers)
  • Rate limiting for brute-force protection
  • CSRF protection

Core Services

ServiceDSLPurpose
entryServiceentryService@contentboxBlog entry CRUD
pageServicepageService@contentboxPage CRUD
contentServicecontentService@contentboxUnified content service
authorServiceauthorService@contentboxAuthor management
categoryServicecategoryService@contentboxCategory CRUD
menuServicemenuService@contentboxMenu management
settingServicesettingService@contentboxSettings management
securityServicesecurityService@contentboxAuthentication/authorization
widgetServicewidgetService@contentboxWidget registry
themeServicethemeService@contentboxTheme management
siteServicesiteService@contentboxMulti-site management
mediaServicemediaService@contentboxMedia management
contentStoreServicecontentStoreService@contentboxKey-value content
twoFactorServicetwoFactorService@contentbox2FA management
cbCBHelper@contentboxCBHelper for theme/UI

CBHelper

The CBHelper@contentbox is the primary API for theme and UI development:

property name="cb" inject="CBHelper@contentbox"

// Site
cb.site()           // Current site entity
cb.siteURL()        // Site base URL
cb.siteName()       // Site name

// Content
cb.getContent()     // Current content (entry/page)
cb.entryURL( entry )
cb.pageURL( page )
cb.categoryURL( category )

// Theme
cb.getThemeSetting( "name" )

// Widgets
cb.widget( "WidgetName", { args } )

// Rendering
cb.renderCollection( template, collection )
cb.renderView( view )

// Menus
cb.menu( "main" )

// Media
cb.mediaURL( media )
cb.mediaURL( media, "thumbnail" )

// RSS
cb.rssURL()
cb.rssCommentsURL()

// Search
cb.searchURL()
cb.searchURL( "query" )

// Subscriptions
cb.subscribeURL()
cb.unsubscribeURL()

Interception Points

Core

PointWhen
cb_onContentRenderingBefore content is rendered
cb_onContentStoreRenderingBefore ContentStore content is rendered

Admin (cbadmin_*)

Layout injection, content editor, content lifecycle, author management, dashboard, settings, and more. See the admin extension skill for the full list.

Content Types

TypeDescription
EntriesBlog posts with dates, categories, comments
PagesStatic pages with hierarchical structure
ContentStoreKey-value content blocks

Widgets

Widgets extend BaseWidget and implement renderIt(). They are discovered from:

  1. Active theme widgets (highest priority)
  2. Custom widgets (_widgets/)
  3. Core widgets
  4. Module widgets

Themes

Themes define the visual presentation. Required files:

  • Theme.bx โ€” metadata, settings, lifecycle callbacks
  • layouts/blog.bx, layouts/pages.bx โ€” mandatory layouts
  • views/index.bx, entry.bx, page.bx, archives.bx, error.bx โ€” mandatory views

API

REST API v1 at /api/v1/ with JWT authentication:

  • Entries, Pages, Categories, Authors, Menus, Sites, Settings, ContentStore
  • CRUD operations with pagination, filtering, sorting
  • Memento-based JSON responses

Commands

# Start local server
box server start

# Migrations
box run-script contentbox:migrate:create name=YourMigration
box run-script contentbox:migrate
box run-script contentbox:migrate:up
box run-script contentbox:migrate:down
box run-script contentbox:migrate:fresh

# Format code
box run-script format
box run-script format:check

# Frontend builds
npm run dev
npm run watch
npm run prod
npm run build-dev
npm run build-prod

Testing

  • Web tests: http://127.0.0.1:8589/tests/runner.cfm
  • API tests: http://127.0.0.1:8589/tests/runner-api.cfm
  • Base classes: tests/resources/BaseTest.cfc, tests/resources/BaseApiTest.cfc

Engine Compatibility

ContentBox supports three engines:

  • Lucee 5+
  • Adobe ColdFusion 2018+
  • BoxLang

Server configs: server-lucee@*.json, server-adobe@*.json, server-boxlang@*.json

Key References