From 14ec6b7e7a4c8843f96f40f9756c744edc1261e9 Mon Sep 17 00:00:00 2001 From: Nick Yeoman Date: Thu, 22 Jan 2026 15:40:46 -0800 Subject: [PATCH] fixed matomo to be in the master twig template. --- skeleton/novaconium/App/config.php | 3 ++- src/novaconium.php | 3 ++- twig/foot.html.twig | 20 +------------------- twig/master.html.twig | 28 ++++++++++++++++++++++++++++ views/404.html.twig | 1 + 5 files changed, 34 insertions(+), 21 deletions(-) diff --git a/skeleton/novaconium/App/config.php b/skeleton/novaconium/App/config.php index cc04b81..e6e653f 100644 --- a/skeleton/novaconium/App/config.php +++ b/skeleton/novaconium/App/config.php @@ -11,6 +11,7 @@ $config = [ 'secure_key' => '', //64 alphanumeric characters 'logfile' => '/logs/novaconium.log', 'loglevel' => 'ERROR', // 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'NONE', - 'matomo' => '1', + 'matomo_url' => 'matomo.4lt.ca', + 'matomo_id' => '0', 'fonts' => 'https://fonts.googleapis.com/css2?family=VT323:wght@400&family=Fira+Code:wght@400;500&display=swap&family=Material+Icons:wght@400;500&display=swap' ]; diff --git a/src/novaconium.php b/src/novaconium.php index 96d8519..13d654f 100644 --- a/src/novaconium.php +++ b/src/novaconium.php @@ -17,7 +17,8 @@ $log = new Logger(\BASEPATH . $config['logfile'], $config['loglevel']); // --- Twig Data Array --- $data = []; $data['fonts'] = $config['fonts'] ?? []; -$data['matomo'] = $config['matomo'] ?? 0; +$data['matomo_url'] = $config['matomo_url'] ?? ''; +$data['matomo_id'] = $config['matomo_id'] ?? '0'; // --- Session --- use Novaconium\Session; diff --git a/twig/foot.html.twig b/twig/foot.html.twig index 8eb18ec..343200e 100644 --- a/twig/foot.html.twig +++ b/twig/foot.html.twig @@ -1,28 +1,10 @@ {% include '@novaconium/javascript/page-edit.html.twig' %} {% if editor == 'ace' %} {% include '@novaconium/javascript/ace.html.twig' %} {% endif %} - -{% if matomo > 0 %} - - - -{% endif %} \ No newline at end of file diff --git a/twig/master.html.twig b/twig/master.html.twig index cd4a60c..53feba1 100644 --- a/twig/master.html.twig +++ b/twig/master.html.twig @@ -60,4 +60,32 @@ {% endif %} {% include ['@override/foot.html.twig', '@novaconium/foot.html.twig'] %} +{% if matomo_id > 0 %} + + + +{% endif %} + diff --git a/views/404.html.twig b/views/404.html.twig index 679e1ef..f875994 100644 --- a/views/404.html.twig +++ b/views/404.html.twig @@ -1,3 +1,4 @@ +{% set is_404 = status_code is defined and status_code == 404 %} {% extends '@novaconium/master.html.twig' %} {% block content %}