What Can I Extend in TruCMS?

Find your goal, then follow the link. Each guide in this section stands on its own.

The two example plugins

Examples use one of two plugins. Testimonials is the complete plugin from the tutorial; its full source is in the tutorial and in the downloadable testimonials-1.0.0.zip. Playground is a smaller illustrative plugin with a Note model (table playground_notes, alias playground), used where Testimonials does not need a feature. Its snippets are complete for the feature they show, but there is no separate download.

By goal

I want to…Use…Registered whereGuide
Add a whole new feature with its own database tablesA plugin (module)Modules/{Name}Tutorial
Add an entry to the admin sidebarMenuManager::make()AdminBooting listenerAdmin menu and dashboard
Show a card, chart or list on the admin dashboardDashboard::admin()->row()->widget()Provider boot()Admin menu and dashboard
Show something on the visitor account dashboardDashboard::user()->row()->widget()Provider boot()Admin menu and dashboard
Add a settings screen or fieldSettingsManager::add()AdminBooting listenerSettings screens
Add a theme colour, typography or layout optionThe defaults block of theme.jsonThemeTheme options
Control who can do whatSpatie permissions + ->can()Migration/seeder + routesPermissions and roles
Add admin or public pagesRoute provider + controllers + viewsModule RouteServiceProviderRoutes, controllers and views
Store data with translations, media or slugsBaseModel, Translatable, HasMedia, HasSlugModelsModels, migrations and media
Let admins choose "which page is the Shop page"AppPages::register(PageDefinition)Provider boot()Page types and public URLs
Give my records pretty URLs like /my-thingResolvableSlug + ResolvedSlugRendererModel + config('slugs.models')Page types and public URLs
Add a draggable block to the page builderShortcode class + Blade componentProvider boot()Shortcodes
Let editors pick records inside a designed sectionBindingSourceProvider boot()Data-bound sections
Add a widget for sidebars and footersWidgets::register() + Arrilot widgetProvider boot()Widgets and widget areas
Add links of my content to the menu builderMenuBuilder::register()AdminBooting listenerMenus and navigation
Ship ready-made page layoutsTemplate sources + a seederModule resources/page-templatesTemplate library
Ship a whole demo siteA niche seeder / .trucms.zip packageSeeders or packageTemplate library
Accept payments for my own recordsPaymentManager on a PayableYour controllersPayments and gateways
Add a payment providerA gateway plugin on TruPaymentsModule providerPayments and gateways
React to bookings, payments, tickets or my own eventsEvent listenersProvider or EventServiceProviderEvents, jobs and schedules
Run something on a schedule or in the backgroundconfigureSchedules(), jobsModule providerEvents, jobs and schedules
Translate the interface or contentLang files, TranslatableModule lang/Localization
Make pages cacheable (or not)doCache, CacheProfile, invalidatorRoutes + modelsCaching
Make my block available to the AI assistant->ai([...]) on the shortcode definitionShortcodeAI assistant
Change how the public site looksA theme (or view overrides)resources/themesCreating a theme
Restyle a plugin without editing itTheme view overrideresources/themes/{theme}/vendor/{alias}/…Routes, controllers and views
Remove or reorder core admin itemsMenuManager::remove(), Dashboard::...->removeRow()Listener / boot()Admin menu and dashboard

By when your code runs

MomentExamples
Every request (register(), boot())Config merge, bindings, translations, breadcrumbs, shortcodes, widget classes, binding sources, app pages, dashboard rows, Blade components, listeners, observers
Admin requests (AdminBooting)Sidebar entries, settings sections, menu-builder sources, removing/reordering core admin items
Render timeShortcode components, widget run(), dashboard widget run(), binding resolve() (bake time)
Deploy timeMigrations, permission migrations/seeders, module:publish, template seeders, composer dump-autoload
Schedule / queueCleanup commands, notification jobs, calendar sync, refresh of baked pages

Core extension points that are not open yet

Being explicit about limits saves time. At present these require a core change (or a workaround):