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:
@@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user