Fix saving modular page

This commit is contained in:
Matias Griese
2014-10-08 19:55:50 +03:00
parent e763d347d9
commit 98b6666f50

View File

@@ -538,16 +538,10 @@ class AdminController
$page->folder($ordering . $slug);
if (isset($input['type'])) {
$page->name(((string) $input['type']) . '.md');
}
if ($page->modular() && isset($input['type'])) {
if (isset($input['frontmatter'])) {
$input['frontmatter'] = 'template: ' . $input['type'] . "\n" . $input['frontmatter'];
}
if (isset($input['header'])) {
$input['header']['template'] = $input['type'];
}
$type = (string) $input['type'];
$name = preg_replace('|.*/|', '', $type) . '.md';
$page->name($name);
$page->template($type);
}
// special case for Expert mode build the raw, unset content