From 95aecde73b5978e18132a120f7f0d7f541394868 Mon Sep 17 00:00:00 2001 From: Ro Date: Mon, 26 Apr 2021 22:44:55 +0000 Subject: [PATCH] quick patch to render class for dynamic theme rendering --- brain/data/Render.inc.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/brain/data/Render.inc.php b/brain/data/Render.inc.php index 51ed995..19e008e 100644 --- a/brain/data/Render.inc.php +++ b/brain/data/Render.inc.php @@ -15,6 +15,7 @@ class Render $this->twig = new \Twig\Environment($this->loader, []); $settings = $config->getSettings(); $this->menu = $settings["menu"]; + $this->theme = $settings["global"]["theme"]; $this->pageInfo = [ "keywords" => isset($settings["global"]["keywords"]) ? $settings["global"]["keywords"] @@ -104,7 +105,7 @@ class Render //$cleaned = html_entity_decode($cleaned, ENT_QUOTES, "UTF-8"); if ($page["layout"] == "index") { - $template = "fipamo-default/index.twig"; + $template = $this->theme . "/index.twig"; $location = "../public/index.html"; $dir = null; @@ -119,7 +120,7 @@ class Render "menu" => $this->menu, ]; } else { - $template = "fipamo-default/page.twig"; + $template = $this->theme . "/page.twig"; $location = "../public/" . $page["path"] . "/" . $page["slug"] . ".html"; $dir = "../public/" . $page["path"]; @@ -142,7 +143,7 @@ class Render public function renderArchive() { $archive = Sorting::archive(); - $template = "fipamo-default/archive.twig"; + $template = $this->theme . "/archive.twig"; $pageOptions = [ "title" => "Archive", "background" => $this->pageInfo["image"], @@ -160,7 +161,7 @@ class Render { $list = Sorting::tags(); foreach ($list as $item) { - $template = "fipamo-default/tags.twig"; + $template = $this->theme . "/tags.twig"; $pageOptions = [ "title" => "Pages Tagged as " . $item["tag_name"], "background" => $this->pageInfo["image"],