Elxis CMS Forum

Support => General => Topic started by: xmanhattan on September 08, 2025, 15:52:33

Title: template five index file and js addin modifications
Post by: xmanhattan on September 08, 2025, 15:52:33
Hello all,
After updating to Elxis 5.6 Oxylus, I noticed that there were changes in the template five index.php file.

Before the update, I used the following code:
Code: [Select]
// add meta tags using method using classes
elxisloader::loadFile('templates/five/includes/seometatags.class.php')."\n";
$seotags = new seometatags();
$seotags->dispseometatags();

elxisloader::loadFile('templates/five/includes/five.class.php');
$tpl5 = new templateFive();
$tplts = filemtime(ELXIS_PATH.'/templates/five/css/template'.$eLang->getinfo('RTLSFX').'.css');

Now I see the following code:
Code: [Select]
$f = ELXIS_PATH.'/templates/five/css/template'.$eLang->getinfo('RTLSFX').'.css';
$integrity = $eDoc->integrityFileHash($f);
$tplts = filemtime($f);

elxisloader::loadFile('templates/five/includes/five.class.php');
$tpl5 = new templateFive();

As I realize that this is an added security measure, as you have added
Code: [Select]
integrity="sha256-<?php echo $integrity;  and  $eDoc->getNonce(); into the html head section link.
How can I add in the seometatags.class.php file?

Another question:  I use the following js addin,
Code: [Select]
<script data-account="999999999" src="https://cdn.userway.org/widget.js"></script>Do I have to modify html script tag for security purposes?

Title: Re: template five index file and js addin modifications
Post by: xmanhattan on September 12, 2025, 11:05:47
Solved.  :D
Title: Re: template five index file and js addin modifications
Post by: datahell on September 13, 2025, 22:04:48
Solved, but just to clarify some things.

Files integrity checksum (sha256) makes sense if you use a CSP policy. Additionally nonce tells the browser to ignore this script. Using these options is strongly recommended for external scripts and css files. CSP (Content Security Policy) tells the browser what to consider safe. If the safe check by the browser fail then the browser doesn't load that resource/code.
Title: Re: template five index file and js addin modifications
Post by: xmanhattan on September 14, 2025, 09:58:16
Hello Datahell,
Luckily, I keep busy with different things including the Arduino, Raspberry, and Python, to keep thinking about the practical side of their use in the home.
I found the following links useful on the subject.
https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy (https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy)
I used this one to create the additional script tag to keep everything proper by taking a link such as https://cdn.userway.org/widget.js (https://cdn.userway.org/widget.js) and entering it into the link below.  This gave me the completed link except for my id.
https://www.srihash.org/ (https://www.srihash.org/)
All the best,
Petros
Title: Re: template five index file and js addin modifications
Post by: datahell on September 14, 2025, 19:01:15
I keep busy with different things including the Arduino, Raspberry, and Python

Ah, more interesting. Tell me, have you built anything yet? Or you just make experiments?
Title: Re: template five index file and js addin modifications
Post by: xmanhattan on September 15, 2025, 09:51:19
Still experimenting.  I find it strange that while using components like the time module, DS3232RTC, that I had to download various libraries in order to get it to work.  I finally did but I don't understand why there can be so many different libraries for various components.
I stopped during the summer and as it becomes cooler, I will start again.  Hopefully, I will create an idea to complete.
Title: Re: template five index file and js addin modifications
Post by: datahell on September 15, 2025, 19:38:22
And the worst part is that there are many libraries with the same name! Some of them work, some others not. As a beginner I advise you to find recent tutorials and use the instructions step by step to replicate the final result. Afterwards you modify the source code to customize it and learn coding. Start with simple thinks like relays, buttons, LEDs, sensors like temperature, humidity, serial communication (eg arduino - arduino), LED displays, etc. You can even buy a starters kits for Arduino. Raspberry Pi on the other hand is something else, you need to have a Linux background. System administration, network, ssh console, etc.
Title: Re: template five index file and js addin modifications
Post by: xmanhattan on September 16, 2025, 08:57:39
Got it, thanks!  ;D