Fix page title

This commit is contained in:
Bruno Rybársky 2024-02-24 09:23:09 +01:00
parent 1650e852cd
commit 21e78d3ceb
2 changed files with 6 additions and 1 deletions

@ -12,6 +12,7 @@
'endpoint_dir' => 'endpoints/',
'page_dir' => 'pages/',
'protocol' => 'https://',
'site_prefix' => 'Adlerka',
'permissions' => [
'logged_out' => 1,
'logged_in_default' => 2,

@ -40,6 +40,10 @@ function renderPage($page_name = null, $site_name = null): array
$site_name = $routerRequest["site_name"];
}
$site_title = str_replace("_", " ", $site_name);
$site_title = ucfirst($site_title);
if(!$page_name){
$page_name = $routerRequest["page_name"];
}
@ -110,7 +114,7 @@ function renderPage($page_name = null, $site_name = null): array
}
if(!empty($pageMetadata["parameters"]["page_title"])){
$page_title = $pageMetadata["parameters"]["page_title"];
$page_title = $routerConfig['site_prefix'] . " " . $site_title . " " . $pageMetadata["parameters"]["page_title"];
}
else{
$page_title = $page_name;