mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 03:16:11 +01:00
handle modular templates on create
This commit is contained in:
@@ -499,12 +499,16 @@ class Admin
|
||||
// Add routing information.
|
||||
$pages->addPage($page, $path);
|
||||
|
||||
// Set if Modular
|
||||
$page->modularTwig($slug[0] == '_');
|
||||
|
||||
// Determine page type.
|
||||
if (isset($this->session->{$page->route()})) {
|
||||
// Found the type and header from the session.
|
||||
$data = $this->session->{$page->route()};
|
||||
$visible = isset($data['visible']) && $data['visible'] != '' ? (bool) $data['visible'] : $this->guessVisibility($page);
|
||||
$page->name($data['type'] . '.md');
|
||||
$name = $page->modular() ? str_replace('modular/', '', $data['type']) : $data['type'];
|
||||
$page->name($name . '.md');
|
||||
$page->header(['title' => $data['title'], 'visible' => $visible]);
|
||||
$page->frontmatter(Yaml::dump((array) $page->header()));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user