Emplty Layout Hotfix

When creating new pages, there is no layout, so the system was pushing a
null error when trying to use string_contains and a null string, so
cleaned that up so it defaults to 'page' when that string is empty
toggle-buttons-#109
Ro 1 year ago
parent 3f9506ac6b
commit 405be1a6ed
Signed by: are0h
GPG Key ID: 29B551CDBD4D3B50

@ -112,6 +112,9 @@ class DashControl
case 'edit':
$page = (new Book())->findPageById($uuid);
$views = [];
if (!isset($page['layout'])) {
$page['layout'] = "page";
}
if (str_contains($page['layout'], 'index')) {
$views = (new Themes())->getCustomIndex();
} else {

@ -107,7 +107,7 @@ class Render
}
$template = $layout . '.twig';
if (str_contains($page['layout'], 'index')) {
if (str_contains($layout, 'index')) {
$location = '../public/index.html';
$dir = null;
} else {

Loading…
Cancel
Save