Fix page title
This commit is contained in:
parent
b51f3d9c6f
commit
7798e41e28
@ -70,6 +70,9 @@ async function handlePageResponse(data) {
|
||||
if (data.Navigation) {
|
||||
navbar.innerHTML = data.Navigation;
|
||||
}
|
||||
if (data.Title) {
|
||||
document.title = data.PageTitle;
|
||||
}
|
||||
|
||||
if (data.Page) {
|
||||
pageArea.innerHTML = data.Page;
|
||||
|
15
lib/page.php
15
lib/page.php
@ -109,10 +109,18 @@ function renderPage($page_name = null, $site_name = null): array
|
||||
$page = "";
|
||||
}
|
||||
|
||||
if(!empty($pageMetadata["parameters"]["page_title"])){
|
||||
$page_title = $pageMetadata["parameters"]["page_title"];
|
||||
}
|
||||
else{
|
||||
$page_title = $page_name;
|
||||
}
|
||||
|
||||
return [
|
||||
"PageContent" => $page,
|
||||
"PageName" => $page_name,
|
||||
"SiteName" => $site_name,
|
||||
"PageTitle" => $page_title,
|
||||
];
|
||||
|
||||
}
|
||||
@ -130,12 +138,7 @@ function getPage($site_name_in = null, $page_name_in = null): string
|
||||
|
||||
$footer = file_get_contents($routerConfig["template_dir"] . "footer.html");
|
||||
|
||||
if(!empty($pageMetadata["parameters"]["page_title"])){
|
||||
$page_title = $pageMetadata["parameters"]["page_title"];
|
||||
}
|
||||
else{
|
||||
$page_title = $page_name;
|
||||
}
|
||||
$page_title = $page_tmp["PageTitle"];
|
||||
$dynamic_style = doDynamicStyling();
|
||||
$dynamic_script_data = [
|
||||
"currentPage" => $page_name,
|
||||
|
Loading…
Reference in New Issue
Block a user