Coding with SPIP 2.1
SPIP 2.1 Technical Documentation

> > > > jquery_plugins

jquery_plugins

This pipeline makes it easy to add JavaScript code which will be inserted into every public and private page (which uses the tag #INSERT_HEAD).

It receives and returns an array that contains the paths (these paths will be completed by the function find_in_path()) of the files to be inserted:

  1. $scripts = pipeline('jquery_plugins', array(
  2. 'javascript/jquery.js',
  3. 'javascript/jquery.form.js',
  4. 'javascript/ajaxCallback.js'
  5. ));

Download

Example

Add the script "jquery.cycle.js" to every page:

  1. function pluginPrefix_jquery_plugins($scripts){
  2. $scripts[] = "javascript/jquery.cycle.js";
  3. return $scripts;
  4. }

Download