Javascript management

With Automne you can directly manage the Javascripts on your site from the administration (for information about Javascript consult the prerequirements).

Script management is accessible from the right sidebar, "Models" tab, then the "Javascripts" link.

Link to Javascript files

You will have a list of your script files and repertories stored in the repertory JS of Automne (/js).

  • Editing a script: select it and click o "Modify"
  • Deleting a script: click n "Delete" after selecting it.  Make sure you no longer need the script before deleting it.

In modification mode you can activate the syntax color (upper-right checkbox) that allows you to have visual guides while editing.

Javascript file edition Javascript file edition with syntax highlighting

You can let Automne manage script loading in your place.

For this you can create a repertory in the repertory module with the name of your module and put the file you want to load inside.

For example for the contact module (codename "pcontact).  You can create a pcontact repertory containing the files checkcontact.js, docontact.js and showcontact.js so that they are loaded on each pages calling on the contact module.

The repertory files are loaded in alphabetical order, iso it is enough to prefix them in order to determine their loading order.

The <atm-js-tags> tag

In the page models it is possible to load your Javascripts via the <atm-js-tag>  tag of Automne. This tag permits automatic loading of desired Javascripts and increases loading performance.

Exemple d'utilisation :

<html>
    <head>
        <atm-js-tags files="/js/jquery-1.3.2.js,/js/common.js" />
    </head>
    <body></body>
</html>

Find out more about <atm-js-tag>.



Bookmark and Share

Top