B
B
Bakitzhan Zhumadilda2020-12-08 21:07:48
Joomla
Bakitzhan Zhumadilda, 2020-12-08 21:07:48

How does each language call a separate java script?

I can't install my own java chat script on joomla for each language

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MKE, 2020-12-09
@MKE

Either in the index.php of the template, or in the developed module - check the selected language for PHP.
See JFactory::getLanguage();
Depending on the language, connect the script. I would rather include such a script before closing body. Perhaps in the debug position.
UPD: another option:
Install the DirectPHP extension and write PHP code directly in the HTML code module. Then you don't need to touch the template and you don't need to write your own module.

S
Sergei Tolkachev, 2020-12-09
@sergeytolkachyov

If you just need different js code for different languages, then create a module of the HTML code type in the module manager, paste the necessary code there and assign the language. Each language has its own module with its own code. You can specify any position for all pages, preferably closer to the end of the page (depending on your template). No need to be smart and get into the template code. DirectPHP is also created for other purposes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question