A template for building Total CMS extensions. Clone this repo, rename it, and start building.
This starter demonstrates every extension point:
| Feature | File | Description |
|---|---|---|
| Twig function | Extension.php |
starter_greet() function |
| Twig filter | Extension.php |
reverse_words filter |
| CLI command | src/Command/GreetCommand.php |
tcms acme:greet |
| Admin page | src/Action/DashboardAction.php |
Page at /ext/acme/starter/dashboard |
| Admin nav | Extension.php |
Sidebar link to the dashboard |
| Dashboard widget | templates/widgets/starter.twig |
Widget on admin home |
| Event listener | Extension.php |
Logs object create/update events |
| Read-only schema | schemas/starter-items.json |
Example collection schema (Pro+) |
| Settings | settings-schema.json |
Configurable greeting message |
- Clone this repo into your T3 extensions directory:
cd tcms-data/extensions/
mkdir your-vendor
cd your-vendor
git clone https://github.com/totalcms/extension-starter.git your-extension
cd your-extension- Update
extension.jsonwith your extension's ID, name, and details:
{
"id": "your-vendor/your-extension",
"name": "Your Extension"
}- Update the PHP namespace in
composer.jsonand all PHP files:
"autoload": {
"psr-4": {
"YourVendor\\YourExtension\\": "src/"
}
}- Install dependencies and generate the autoloader:
composer install- Enable the extension:
tcms extension:enable your-vendor/your-extension- Delete the parts you don't need and start building.
your-extension/
extension.json # Manifest (required)
Extension.php # Entry point (required)
composer.json # Dependencies and autoloading
settings-schema.json # Settings form definition
src/
Action/ # HTTP action handlers
Command/ # CLI commands
schemas/ # Read-only schemas (Pro+)
templates/ # Twig templates
MIT