NEW The global header of a website can also have dynamic content

This commit is contained in:
Laurent Destailleur 2020-06-09 22:07:06 +02:00
parent 0f1447cf05
commit a9b85222c0

View File

@ -202,14 +202,16 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage)
}
$tplcontent .= '<?php } ?>'."\n";
}
// Add manifest.json on homepage
// Add manifest.json. Do we have to add it only on home page ?
$tplcontent .= '<?php if ($website->use_manifest) { print \'<link rel="manifest" href="/manifest.json.php" />\'."\n"; } ?>'."\n";
$tplcontent .= '<!-- Include link to CSS file -->'."\n";
// Add js
$tplcontent .= '<link rel="stylesheet" href="/styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'."\n";
$tplcontent .= '<!-- Include link to JS file -->'."\n";
$tplcontent .= '<script src="/javascript.js.php"></script>'."\n";
// Add headers
$tplcontent .= '<!-- Include HTML header from common file -->'."\n";
$tplcontent .= '<?php print preg_replace(\'/<\/?html>/ims\', \'\', file_get_contents(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")); ?>'."\n";
$tplcontent .= '<?php if (file_exists(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")) include DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html"; ?>'."\n";
$tplcontent .= '<!-- Include HTML header from page header block -->'."\n";
$tplcontent .= preg_replace('/<\/?html>/ims', '', $objectpage->htmlheader)."\n";
$tplcontent .= '</head>'."\n";