Settings: Custom HTML for <head> and <body>

This commit is contained in:
slawkens
2026-01-31 16:01:34 +01:00
parent 9d6287ecbc
commit 108e83806d
2 changed files with 29 additions and 0 deletions

View File

@@ -515,7 +515,12 @@ function template_place_holder($type): string
$ret .= $debugBarRenderer->renderHead(); $ret .= $debugBarRenderer->renderHead();
} }
} }
elseif ($type === 'head_end') {
$ret .= setting('core.html_head');
}
elseif ($type === 'body_start') { elseif ($type === 'body_start') {
$ret .= setting('core.html_body');
$ret .= $twig->render('browsehappy.html.twig'); $ret .= $twig->render('browsehappy.html.twig');
if (admin()) { if (admin()) {
@@ -526,6 +531,8 @@ function template_place_holder($type): string
} }
} }
elseif($type === 'body_end') { elseif($type === 'body_end') {
$ret .= setting('core.html_footer');
$ret .= template_ga_code(); $ret .= template_ga_code();
if (isset($debugBar)) { if (isset($debugBar)) {
$ret .= $debugBarRenderer->render(); $ret .= $debugBarRenderer->render();

View File

@@ -251,6 +251,28 @@ return [
'desc' => 'Allow MyAAC to report anonymous usage statistics to developers? The data is sent only once per 30 days and is fully confidential. It won\'t affect the performance of your website', 'desc' => 'Allow MyAAC to report anonymous usage statistics to developers? The data is sent only once per 30 days and is fully confidential. It won\'t affect the performance of your website',
'default' => true, 'default' => true,
], ],
[
'type' => 'section',
'title' => 'Custom HTML',
],
'html_head' => [
'name' => 'HTML Head',
'type' => 'textarea',
'desc' => escapeHtml('These scripts will be printed in the <head> section. Can be, for example, Google Analytics code.'),
'default' => '',
],
'html_body' => [
'name' => 'HTML Body',
'type' => 'textarea',
'desc' => escapeHtml('These scripts will be printed just below the opening <body> tag.'),
'default' => '',
],
'html_footer' => [
'name' => 'HTML Footer',
'type' => 'textarea',
'desc' => escapeHtml('These scripts will be printed above the closing </body> tag.'),
'default' => '',
],
[ [
'type' => 'category', 'type' => 'category',
'title' => 'Game', 'title' => 'Game',