mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 19:06:16 +01:00
Fix saving modular page
This commit is contained in:
@@ -538,16 +538,10 @@ class AdminController
|
|||||||
$page->folder($ordering . $slug);
|
$page->folder($ordering . $slug);
|
||||||
|
|
||||||
if (isset($input['type'])) {
|
if (isset($input['type'])) {
|
||||||
$page->name(((string) $input['type']) . '.md');
|
$type = (string) $input['type'];
|
||||||
}
|
$name = preg_replace('|.*/|', '', $type) . '.md';
|
||||||
|
$page->name($name);
|
||||||
if ($page->modular() && isset($input['type'])) {
|
$page->template($type);
|
||||||
if (isset($input['frontmatter'])) {
|
|
||||||
$input['frontmatter'] = 'template: ' . $input['type'] . "\n" . $input['frontmatter'];
|
|
||||||
}
|
|
||||||
if (isset($input['header'])) {
|
|
||||||
$input['header']['template'] = $input['type'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// special case for Expert mode build the raw, unset content
|
// special case for Expert mode build the raw, unset content
|
||||||
|
|||||||
Reference in New Issue
Block a user