JS Inclusion Custom Module

Priya

In Drupal, including JavaScript to a page is a challenging task every site builders/administrators come across in their day to day operation. Site builders have to seek developers support to incorporate the same. JS inclusion module provides a way for site builders to add JavaScript to pages in simple ways. This module can be used for including simple or complex JS modifications without affecting/changing the site theme.

In the session, I would like to cover more comprehensively the various ways of including the JS which includes file upload, through link and inline JS. Using this module, scripts can be loaded from any of the three sources like include a JS file via settings.php, include JS directly and globally via an admin UI and include JS either directly or by uploading a file in a panel via ctools plugin.

The key features of the module include option for

  • like upload for site builders
  • link (internal/external)
  • direct input(js code)

The module also has header and/or footer placement option and ability to load JS into appropriate pages from all sources with multiple inclusions. There will be a global configuration to select the default order for inclusion by source (plugin then global UI then settings.php) which can be enabled or disabled.

Site builder will be able to supply a weight for each added JS (which will be used in drupal_add_js) if the global order configuration is disabled. Along with features, the backend architecture and JS loading order will be presented in-depth. 

Session Track

Site Building

Experience Level

Intermediate

Drupal Version