Plugin sidebar order + directory layout from index.md

- PluginManager: iterate allowedPlugins in user-defined order (frontmatter order)
- content-edit.twig: plugin list with up/down arrows to set order
- Directory listing: read layout/plugins from index.md if present
- Directory default layout: full_content (no sidebar) unless index.md says otherwise
This commit is contained in:
2026-08-11 17:04:27 +02:00
parent 342112cd21
commit 03a14126ca
4 changed files with 143 additions and 33 deletions
+14 -1
View File
@@ -1141,9 +1141,22 @@ class CodePressCMS {
$content .= '<p>' . $this->t('directory_empty') . '.</p>';
}
// Check for index.md in this directory for layout/plugins metadata
$indexFile = $dirPath . '/index.md';
$layout = 'full_content';
$metadata = [];
if (file_exists($indexFile)) {
$indexContent = file_get_contents($indexFile);
$parsed = $this->parseMetadata($indexContent);
$metadata = $parsed['metadata'];
$layout = $metadata['layout'] ?? 'full_content';
}
return [
'title' => $title,
'content' => $content
'content' => $content,
'layout' => $layout,
'metadata' => $metadata,
];
}