How to insert a script in joomla

How to insert a script in joomla


Joomla is a popular management systemsite, which has very wide functionality. Most often they are not used for a quarter, and from advanced options, site administrators may need, for example, inserting scripts in javascript into pages. You can do this by creating an appropriate module in the admin panel.



How to insert a script in joomla


Instructions


1


If the script is contained in a separate file withextension js, you should first place it on the site server, and then add the HTML tags of the call to this script to the code of the necessary pages. To download the file, use any of the methods you know. 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 similar manager of the site management system.


2


Then, in the Joomla administration panel, open thesection related to the installed modules in the system and make sure that there is a module in it that allows you to insert arbitrary HTML-code into documents. The names they have are different, but most often use Special HTML - this is the most common component of this type. Click the "New" button, in the loaded form, check the box next to Special HTML and click the "Next" icon.


3


In the "Title" field of the form that appears, enterThe name by which you can later determine what kind of script is invoked by this module. HTML-tag of the file call with the script enter in the HTML / javascript field. In some versions of Joomla with a visual editor, this should be done after disabling the WYSIWYG mode. The script loading script from an external file generally looks like this: <script type = "text / javascript" src = "http://kakprosto.ru/some.js"> </ script>. Here in quotes after src you need to specify the address by which the file was uploaded in the first step. If the script should not be stored in an external file, then paste it instead of this tag.


4


In the "Position" field, enter, for example, JSOutput, inIn the drop-down list "Display header", select "No", and in the "Enabled" list, select "Yes". Click on the "Save" button and on this the preparation of the script module for inserting into the pages will be completed.


5


Select an article or a static page in thewhich you must insert the module containing the script, and in the visual editor click the place to display it. Then paste the {loadposition JSOutput} code and save the modified page.