Intro To jQuery In Drupal - Presentation Transcript
Introduction to
jQuery in Drupal
Matt Farina
Developing for web since 1996
Coded In Over 10 Languages
Developer at Tree House Agency
Drupal and jQuery Developer
I Used To Build Military Tanks
A Little History
jQuery chosen for drupal core before
release of jQuery 1.0
jQuery 1.0.4 shipped with drupal 5
Drupal 5 used jQuery to spruce up
interface
jQuery 1.2.3 shipped with Drupal 6
Drupal 6 translations, themes, libraries
Currently jQuery 1.2.6 in Drupal 6
Drupal 7 to ship with latest version of
jQuery (current Dev is 1.3).
Add JavaScript In
Your Theme
Printing Scripts In Your Theme
In your page.tpl.php file(s) include:
<?php print $scripts; ?>
The Default script.js file
/sites/all/themes/mytheme
/sites/all/themes/mytheme/
mytheme.info
/sites/all/themes/mytheme/script.js
by default script.js will be included
Defining Scripts in .info
In you mytheme.info file:
scripts[] = ascript.js
scripts[] = jquery.plugin.js
scripts[] = bscript.js
Order of Files
Core (jQuery.js and drupal.js)
Module JS Files
Theme JS Files
Translating Stuff
!variable: inserted as is
@variable: escape plain text to HTML
(Drupal.checkPlain)
%variable: escape text and theme as a
placeholder for user-submitted
This presentation is a top level overview of how to more
This presentation is a top level overview of how to work with JavaScript in drupal. This includes drupal specific techniques, integration between the front end and back end, and JS aggregation and special features. less
0 comments
Post a comment