mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 11:26:04 +01:00
force modular class for modular template type
This commit is contained in:
@@ -507,9 +507,16 @@ class Admin
|
|||||||
// Found the type and header from the session.
|
// Found the type and header from the session.
|
||||||
$data = $this->session->{$page->route()};
|
$data = $this->session->{$page->route()};
|
||||||
$visible = isset($data['visible']) && $data['visible'] != '' ? (bool) $data['visible'] : $this->guessVisibility($page);
|
$visible = isset($data['visible']) && $data['visible'] != '' ? (bool) $data['visible'] : $this->guessVisibility($page);
|
||||||
|
|
||||||
|
$header = ['title' => $data['title'], 'visible' => $visible];
|
||||||
|
|
||||||
|
if ($data['type'] == 'modular') {
|
||||||
|
$header['body_classes'] = 'modular';
|
||||||
|
}
|
||||||
|
|
||||||
$name = $page->modular() ? str_replace('modular/', '', $data['type']) : $data['type'];
|
$name = $page->modular() ? str_replace('modular/', '', $data['type']) : $data['type'];
|
||||||
$page->name($name . '.md');
|
$page->name($name . '.md');
|
||||||
$page->header(['title' => $data['title'], 'visible' => $visible]);
|
$page->header($header);
|
||||||
$page->frontmatter(Yaml::dump((array) $page->header()));
|
$page->frontmatter(Yaml::dump((array) $page->header()));
|
||||||
} else {
|
} else {
|
||||||
// Find out the type by looking at the parent.
|
// Find out the type by looking at the parent.
|
||||||
|
|||||||
Reference in New Issue
Block a user