- Reorganize admin into admin/theme/default/ (views + assets) - Rename GuideNav to Navigation plugin (essential, protected) - Plugin assets support (SCSS/CSS) loaded after theme CSS - User roles: Admin, Content Manager, BI Manager, Site Admin - Role-based access control (RBAC) for admin routes and sidebar - Guide restructure: sub-topics in separate folders with sidebar nav - Dynamic breadcrumb for homepage and subdirectories - Fix theme path traversal (../../ -> ../) in admin.php - Fix CodeMirror mode load order (xml -> css -> js -> htmlmixed -> php) - Fix editor-toolbar.js null checks for plugin edit pages - Layout select from theme.json with live frontmatter update - Footer sticky at bottom of viewport (min-height: 100vh) - Breadcrumb color fix (var(--nav-font) -> var(--header-bg)) - Remove language switcher from guide pages - Update README.md and README.en.md - Bump version to 2.5.1
CodePress CMS Plugins
Deze map bevat plugins voor de CodePress CMS. Elke plugin heeft zijn eigen submap met de plugin code.
Plugin Structuur
Elke plugin map moet het volgende bevatten:
PluginName/
├── PluginName.php # Hoofd plugin bestand
├── README.md # Plugin documentatie (optioneel)
├── config.json # Plugin configuratie (optioneel)
└── assets/ # CSS, JS, images (optioneel)
├── css/
├── js/
└── images/
Beschikbare Plugins
HTMLBlock
Toont een custom HTML blok in de sidebar met pagina-informatie en navigatie.
Locatie: HTMLBlock/HTMLBlock.php
Functies:
- Toont huidige pagina informatie
- Dynamische navigatie
- Bestandsinformatie
- Interactive controls
Plugin Development
Basis Plugin Class
<?php
class MyPlugin
{
private ?CMSAPI $api = null;
public function setAPI(CMSAPI $api): void
{
$this->api = $api;
}
public function getSidebarContent(): string
{
return '<div>Mijn plugin content</div>';
}
}
Beschikbare API Methodes
getCurrentPage()- Huidige pagina datagetCurrentPageTitle()- Huidige pagina titelgetMenu()- Menu structuurgetConfig($key)- Configuratie waardestranslate($key)- VertalingengetCurrentLanguage()- Huidige taalisHomepage()- Check of homepagegetCurrentPageFileInfo()- BestandsinformatiecreateUrl($page, $lang)- URL generatie
Plugin Hooks
Plugins kunnen de volgende methodes implementeren:
getSidebarContent()- Content voor sidebarsetAPI(CMSAPI $api)- API injectie
Configuratie
Plugins kunnen een config.json bestand hebben:
{
"enabled": true,
"settings": {
"option1": "value1",
"option2": "value2"
}
}
Installatie
- Maak een nieuwe map in
plugins/ - Plaats de plugin class in
PluginName/PluginName.php - Optioneel: voeg README.md en config.json toe
- De plugin wordt automatisch geladen door de CMS
Best Practices
- Gebruik
htmlspecialchars()voor output - Implementeer
setAPI()voor CMS toegang - Volg PSR-12 coding standards
- Gebruik namespace indien nodig
- Documenteer je plugin met README.md