8. WE WILL FOCUS ON
•
Drupal
•
Wordpress
•
Joomla!
•
Expression Engine
9.
10. DRUPAL JS OVERVIEW
•
Started with ‘generic’, settled on JQuery
•
Currently D7 ships with JQuery 1.4.2 / UI 1.8
•
Can easily (and often is) upgraded to latest
•
Used for UI enhancements, ajax DOM manipulation
etc…
•
All js is aggregated (if turned on)
11. OTHER OPTIONS
Umpteen UI modules (carousels, selectors,
Modals), JSON processing, Dynamic forms,
Responsive, Masonry, Modernizr, AngularJS,
Backbone, NodeJS and many many more…
12. ADDING JS
drupal_add_js() - The path to your js code + some parameters.
These allow to pass settings, how JS is to be rendered, where/when
it’s to be loaded
Four sets of arrays can be passed var Drupal = Drupal || { 'settings': {},
'behaviors': {}, 'themes': {}, 'locale': {} };
15. WORDPRESS JS OVERVIEW
•
Currently ships with JQuery 1.11, Backbone,
TinyMCE and a few other scripts
•
Can easily be upgraded to latest
•
Used for UI enhancements, ajax DOM manipulation
etc…
•
Can be aggregated through plugins
20. JOOMLA! JS OVERVIEW
•
Currently ships with JQuery 1.81, Bootstrap, JQuery
UI 1.8.23 and Mootools/Joomla JS
•
Can easily be upgraded to latest
•
Used for UI enhancements, ajax DOM manipulation
etc…
•
Can be aggregated through plugins
25. EXPRESSION ENGINE JS
OVERVIEW
•
JQuery v1.6.2?
•
Can’t be upgraded
•
Used for UI enhancements, ajax DOM
manipulation etc…
•
Assume it has JS aggregation
All PHP, two open source, two proprietary and ones I know the best.
I wanted to add more proprietary options, but it’s really hard to find information.
Drupal, PHP CMS, popular with large, complex sites and is thus quite complex itself.
At the same time, module developers were starting to incorporate advanced effects libraries like Dojo, moo.fx, and prototype
In modules and themes, things can just be fudged in of course…
Settings
behaviours to be acted upon - This is so Drupal is also aware of what is going on / DOM changes and can react / cache properly
theme - Adds ability for client side DOM elements to be properly styled
locale - Translations
Even official docs mention adding into <head> / header.php…
‘Official’ way
Name (required, string): The name of the script.
URL (required, string):
Dependencies (optional, array):
Version (optional, string):
Load in Footer (optional, boolean):
There are specific enqueue functions for front / admin / login pages
Notice how this is exactly the same…
Mootools is deprecated
Joomla is more MVC based, so JS can be added in various front end locations, out of scope for this talk.
* Note quite ‘native’ plugins.
Into templates
File to load something other than JQuery
2nd - Modules
Not saying there aren’t any, but it’s not made very clear or easy to find.
Wordpress and Joomla quickly and for fairly one shot
Drupal more complex allowing for more flexibility that may not be needed.