Beginning Jquery In Drupal Theming

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

3 comments

Comments 1 - 3 of 3 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

13 Favorites & 1 Group

Beginning Jquery In Drupal Theming - Presentation Transcript

  1. Using jQuery in Theming Rob Knight BADCamp 2007 1 1
  2. Prerequisites ‣ Firefox ‣ Firebug Plugin (http://getfirebug.com) ‣ JQuerify Bookmarklet (http://tinyurl.com/2z74ol) ‣ Drupal 5 install to play with ‣ JQuery Update module (http://tinyurl.com/2bxw87) 2
  3. jQuery Philosophy ‣ Progressive Enhancement ‣ Unobtrusive ‣ Lightweight 3
  4. Additionally ‣ Tame the IE 6 demons ‣ Tame the IE 7 demons (fewer) ‣ Use CSS3 in browsers that lack support 4
  5. jQuery & Drupal ‣ jQuery (v1.0) is baked-in as of Drupal 5 ‣ Upgrade to v1.2 with jquery_update ‣ drupal_add_js() to add it to your node(s) 5
  6. Setting Up for Development ‣ jQuerify - change “src” for script – Your Drupal jquery url (/misc/jquery.js) – http://yoursite.com/jquery.js 6
  7. Setting Up for Development ‣ Firebug – Console – Options > Larger Command Line – http://docs.jquery.com in a new tab for reference 7
  8. Let’s Play 8
  9. 1st Victim: nytimes.com 1. 2. Firebug Console 9
  10. 1st Victim: nytimes.com $(‘p’).hide(‘slow’); Paragraphs vanish 10
  11. 1st Victim: nytimes.com $(‘p’).show(‘slow’); Paragraphs return 11
  12. Firebug Console Shows: - output of your commands - affected DOM elements - syntax errors 12
  13. Add to Drupal ‣ Enclose the commands in “ready” function $(document).ready( function() { $(‘p’).hide(‘slow’); }); 13
  14. Add to Drupal ‣ Save in a file in /yourtheme/scripts/file.js ‣ In template.php: drupal_add_js(path_to_theme().‘file.js’, ‘theme’, ‘header’); ‣ (Optional) Use logic to specify when to call otherwise it will be called on all pages. ‣ jQuery loaded automatically when you use drupal_add_js(). 14
  15. Resources ‣ http://docs.jquery.com drupal_add_js API Reference ‣ ‣ http://learningjquery.com ‣ Hacking Digg.com with Firebug 15

Rob KnightRob Knight, 2 years ago

custom

17160 views, 13 favs, 13 embeds more stats

Getting setup to use JQuery in your Drupal theme fo more

More Info

CC Attribution License

Go to text version
  • Total Views 17160
    • 17126 on SlideShare
    • 34 from embeds
  • Comments 3
  • Favorites 13
  • Downloads 337
Most viewed embeds
  • 10 views on http://playdrupal.com
  • 9 views on http://vle.worldbank.org
  • 5 views on http://drupalranch.com
  • 1 views on http://bler.webschuur.com
  • 1 views on http://www.dvd-photo.slideshow.com

more

All embeds
  • 10 views on http://playdrupal.com
  • 9 views on http://vle.worldbank.org
  • 5 views on http://drupalranch.com
  • 1 views on http://bler.webschuur.com
  • 1 views on http://www.dvd-photo.slideshow.com
  • 1 views on http://192.168.10.100
  • 1 views on http://www.playdrupal.com
  • 1 views on http://www.drupalranch.com
  • 1 views on http://www.koehl-media.de
  • 1 views on http://localhost:8888
  • 1 views on http://connect2.prud.us
  • 1 views on http://www.angrydonuts.com
  • 1 views on http://radiusgreen.com

less

Flagged as inappropriate Flag as inappropriate
Flag as innappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel

Categories

Groups / Events