- Admin guide: RBAC roles, role-based dashboard, plugin types (content/system) - CodePress developer guide: plugin types, admin plugin API, SCSS compilation, asset serving - Theme developer guide: SCSS sole CSS source, css_compiled read-only, guide layout - Content manager guide: layout selection from theme.json, plugin order in frontmatter - Both NL and EN updated with identical structure - 35 files updated
2.0 KiB
2.0 KiB
Plugins
Plugin types
CodePress has two kinds of plugins, determined by the type field in plugin.json:
- Content plugins (
type: "content") — Appear in the sidebar and in the plugin selection on content-edit pages. Provide sidebar content viagetSidebarContent(). - System plugins (
type: "system") — Are loaded by PluginManager but do NOT appear in the sidebar. Provide functionality via admin menu, routes and the CMSAPI. Registered viagetAdminMenu()andgetAdminRoutes().
When no type field is present, content is assumed.
Essential plugins
Essential plugins are defined in getProtectedPlugins() in public/admin.php. Current essential plugin: Navigation.
These plugins:
- Cannot be deactivated
- Cannot be edited
- Cannot be deleted
On the plugins page they get an Essential badge instead of the action buttons.
Managing plugins
- Activate/Deactivate — Turn a plugin on/off (not for essential plugins)
- Edit — Modify plugin code in CodeMirror (not for essential plugins)
- Configuration — Edit plugin settings
- Delete — Remove the plugin folder (not for essential plugins)
The admin plugins page shows a Content or System badge per plugin.
Creating a new plugin
- Go to Plugins → New plugin
- Enter a name (e.g.
MyPlugin) — this becomes the folder name - Choose the type: Content or System
- The file
MyPlugin.phpis created (NOTplugin.php) - Edit the plugin code in CodeMirror
- Activate the plugin
Plugin filename
Plugin PHP files are named <PluginName>.php (e.g. Navigation.php, HTMLBlock.php). PluginManager loads $pluginDir . '/' . $pluginName . '.php'.
Plugin CSS
- Content and system plugins can have their own CSS in
assets/scss/andassets/css/ - Plugin CSS is automatically loaded after theme CSS (in
base.twig), so themes can override plugin styling - Plugin assets are served via
cms/router.phpat URL/plugins/<Name>/assets/...