Joomla is a popular content management system that has very broad functionality. Most often, they are not used by a quarter, and of the advanced options, site administrators sometimes need, for example, inserting JavaScript scripts into pages. This can be done by creating a corresponding module in the admin panel.
Instructions
Step 1
If the script is contained in a separate file with the js extension, you should first place it on the site server, and then add HTML tags to call this script to the code of the required pages. Use any of the methods you are familiar with to download the file. This can be done using the FTP client program installed on the computer, using the file manager of the hosting company's control panel, or a similar manager of the site management system.
Step 2
Then, in the Joomla admin panel, open the section related to the modules installed in the system and make sure that it has a module that allows you to insert arbitrary HTML code into documents. They have different names, but most often they use Special HTML - this is the most common component of this type. Click the "New" button, in the loaded form, put a checkmark in front of the inscription Special HTML and click the "Next" icon.
Step 3
In the "Title" field of the form that appears, enter a name by which you can later determine what kind of script is called by this module. Enter the HTML tag for calling the script file into the HTML / JavaScript field. In some versions of Joomla with a visual editor, this must be done after disabling WYSIWYG mode. The tag for loading a script from an external file generally looks like this:. Here, in quotes after src, you need to specify the address where the file was downloaded in the first step. If the script should not be stored in an external file, then insert it instead of this tag.
Step 4
In the "Position" field, enter, for example, JSOutput, in the "Display title" drop-down list select "No", and in the "Enabled" list - "Yes". Click on the "Save" button and this will complete the preparation of the script module for insertion into pages.
Step 5
Select an article or a static page where you want to insert the module containing the script, and in the visual editor, click the place to display it. Then paste in the {loadposition JSOutput} code and save the modified page.