This is the right place to report general bugs, make suggestions or ask for help.
-
ClarusAD
- Posts: 3
- Joined: Sun Oct 05, 2025 9:10 am
Post
by ClarusAD » Sun Oct 05, 2025 11:19 am
Hello,
When i write some JS code in the header file
flatpress/fp-interface/themes/leggero/header.tpl
For example :
Code: Select all
{literal}<script> alert() </script>{/literal}
That doesn't work, and i don't understand why…
Can someone help me ?
Thank-you in advance
-
fraenkiman
- Posts: 368
- Joined: Thu Feb 03, 2022 7:25 pm
- Location: Berlin, Germany
-
Contact:
Post
by fraenkiman » Mon Oct 06, 2025 12:38 am
Hello ClarusAD,
Try using
Code: Select all
{literal}<script nonce="{/literal}{$smarty.const.RANDOM_HEX}{literal}">…</script>{/literal}
Or with externally integrated JS:
Code: Select all
<script nonce="{$smarty.const.RANDOM_HEX}" src="{$smarty.const.BLOG_BASEURL}fp-interface/themes/leggero/res/custom.js" defer></script>
Otherwise, your browser will block the execution of the inline script.

- Screenshot 2025-10-06 024126.png (102.38 KiB) Viewed 199 times
Have a great start to the new week.
Best regards,
Frank
-
ClarusAD
- Posts: 3
- Joined: Sun Oct 05, 2025 9:10 am
Post
by ClarusAD » Mon Oct 06, 2025 4:42 pm
Thank-you Fraenkiman, you're a king ! The soluce was to add the "nonce" part :
Code: Select all
{literal}<script nonce="{/literal}{$smarty.const.RANDOM_HEX}{literal}">…</script>{/literal}
Who is online
Users browsing this forum: Ahrefs [Bot] and 0 guests