Page 1 of 1

Where to add external sources (Javascripts)

Posted: Thu Feb 22, 2024 8:47 am
by caigner
I want to use Hyphenopoly in my project.

Are there recommendations (best practices) as to where to put such external sources?

Regards,
Christian

Re: Where to add external sources (Javascripts)

Posted: Thu Feb 22, 2024 2:24 pm
by DIGI3
If you mean the files, the assets folder is ideal - I usually make a 'js' folder inside it. If you mean the script tags, usually just before the closing <__body> tag. You might also want to look at CMSMSExt for {xtjs_add} and its related tags.

Re: Where to add external sources (Javascripts)

Posted: Tue Feb 27, 2024 8:41 am
by creopard
What is the advantage of this Hyphenopoly.js implementation instead of letting the browser handle hyphenation automatically with CSS like:

Code: Select all

hyphens:auto;
hyphenate-limit-chars:auto 5;
hyphenate-limit-lines:2;

Re: Where to add external sources (Javascripts)

Posted: Tue Feb 27, 2024 10:12 am
by pierrepercee
Hello Creopard,

You can use it with old browsers that do not support these css rules. Official sites (town halls for example) sometimes have backward compatibility requirements with very old browsers.