diff --git a/src/AntCMS/AntCMS.php b/src/AntCMS/AntCMS.php index 7072d62..44157bc 100644 --- a/src/AntCMS/AntCMS.php +++ b/src/AntCMS/AntCMS.php @@ -63,12 +63,8 @@ class AntCMS */ public static function getPageLayout(string $theme = null, string $currentPage = '') { - $siteInfo = AntCMS::getSiteInfo(); - $pageTemplate = self::getThemeTemplate('default', $theme); - $pageTemplate = str_replace('', AntPages::generateNavigation(self::getThemeTemplate('nav', $theme), $currentPage), $pageTemplate); - - return $pageTemplate = str_replace('', $siteInfo['siteTitle'], $pageTemplate); + return str_replace('', AntPages::generateNavigation(self::getThemeTemplate('nav', $theme), $currentPage), $pageTemplate); } /** diff --git a/src/AntCMS/AntTwig.php b/src/AntCMS/AntTwig.php index 44e1353..3e31d11 100644 --- a/src/AntCMS/AntTwig.php +++ b/src/AntCMS/AntTwig.php @@ -30,6 +30,9 @@ class AntTwig { $subLayout = AntCMS::getThemeTemplate($layout, $this->theme); $mainLayout = AntCMS::getPageLayout($this->theme); + $siteInfo = AntCMS::getSiteInfo(); + + $params['AntCMSSiteTitle'] = $siteInfo['siteTitle']; $params['AntCMSBody'] = $this->twigEnvironment->render($subLayout, $params); return $this->twigEnvironment->render($mainLayout, $params); @@ -37,6 +40,9 @@ class AntTwig public function renderWithTiwg(string $content = '', array $params = array()) { + $siteInfo = AntCMS::getSiteInfo(); + $params['AntCMSSiteTitle'] = $siteInfo['siteTitle']; + return $this->twigEnvironment->render($content, $params); } } diff --git a/src/Themes/Bootstrap/Templates/default.html.twig b/src/Themes/Bootstrap/Templates/default.html.twig index 2221bec..2cca33d 100644 --- a/src/Themes/Bootstrap/Templates/default.html.twig +++ b/src/Themes/Bootstrap/Templates/default.html.twig @@ -18,7 +18,7 @@