Building Packages
Concrete CMS packages are modular components that extend the functionality of the platform. This skill is essential for developers who want to create custom functionality or integrate third-party services into their Concrete CMS projects.
Basic Workflow for Package Development
Follow these steps to develop a custom package in Concrete CMS:
- Initialize the Package Directory:
Create a new directory under
packages/with a lowercase, underscore-separated name (e.g.,packages/my_custom_package). - Create the Package Controller:
Create a
controller.phpfile in the package root. Define the package handle, version, and basic information.- Package Structure and Controller Reference
- Implement Installation Logic:
In the
install()method of your controller, add code to register block types, themes, single pages, or other entities.- Installing Entities Reference
- Add Custom Functionality:
- Extend Core Classes: Extending Core Classes Reference
- Custom Block Types: Use the
building-blocktypesskill. - Single Pages: Use the
building-singlepagesskill. - Routes and Services: Routing and Service Providers Reference
- Install the Package:
Use the Concrete CMS Dashboard or CLI (
concrete/bin/concrete c5:package:install my_custom_package) to install your package. - Update and Refine:
When making changes to the package structure (like adding a new block type), update the
$pkgVersionincontroller.php, implement theupgrade()method, and run the update from the Dashboard or CLI (concrete/bin/concrete c5:package:update my_custom_package).
Reference Documentation
- Package Structure and Creation
- Installing Entities (Blocks, Themes, Attributes, etc.)
- Creating Attribute Keys (Modern API)
- Extending Core Classes
- Registering Routes and Service Providers