Making The Drupal Pill Easier To Swallow

Embed Size (px)

Citation preview

Making TheDrupal PillEasier ToSwallow

Bloghttp:///www.norton42.org.uk/

Twitter@philipnorton42

#! codehttp://www.hashbangcode.com/

#! code on Twitter@hashbangcode

Philip Norton

Helpful Modules

Devel

A set of functions and callbacks that allow you to inspect what Drupal is doing

Good for seeing what is being loaded on a node or what is going on during the page load

dpm(), dvm(), dargs()

Plenty more at http://bit.ly/qKVAc6

Project Page http://drupal.org/project/devel

Devel Themer

Devel submodule

Allows inspection of the theme layer

Shows all hooks and template files were (or can be) used to generate the element

Project Page http://drupal.org/project/devel_themer

Drupal For Firebug

Inspect your Drupal/Devel output using Firebug extension (http://bit.ly/ofkgaJ)

View debug information without printing it to screen

Also available for Chrome (http://bit.ly/pEnZI4)

Project Page http://drupal.org/project/drupalforfirebug

Advanced Help

Some projects implement a hook_help() hook.

Advanced help is for more detailed help documentation.

Good example is the Views module.

Project Page http://drupal.org/project/advanced_help

UnderstandingHow Drupal Works

Examples Module

A set of example modules for different parts of Drupal

Everything from AHAH to XMLRPC

Many examples come with unit tests

Project Page http://drupal.org/project/examples

Schema Module

Helps when learning about the schema api

Inspect your database structure

Project Page http://drupal.org/project/examples

Unit Testing Drupal

Tricky to set up on Drupal 6, but Drupal 7 now has SimpleTest built in

Every test installs Drupal with no settings so you have to set everything up before you test

Essential skill to have for module developers

Great way to learn how Drupal really works

Project Page http://drupal.org/project/simpletest

Xdebug

PHP debugging tool

Turn it on and watch how Drupal bootstraps and loads a page

Add breakpoints to make sure your hooks are being fired

Nice alternative to print_r()/dpm() when inspecting variables (especially Views)

Get Your Hands Dirty

The best way to learn is to jump in and have a go

Set up a localhost Drupal site and try one or more of the following (no core hacks allowed):

- Change the title of the 'Vocabularies' section on the node form to read 'Details'- Add a dynamic set of links to a menu option- Change the message the user sees when logging in- Install the WYSIWYG module and set the height of each element to be half of the default

Community

Drupal.org

Commonly known as 'd.o'

The Drupal community starts here

Not just somewhere to find documentation

Join some groups and get involved!

IRC

Internet Relay Chat

#drupal Everything Drupal

#drupal-uk Drupal in the UK

Drop in and join in on the chat

Common Etiquette

Don't ask to ask, just ask

Contribute bug reports and patches back to module developers

tl;dr

Be nice!

Other Resources

Books

Pro Drupal (7) Development

Blogs

Drupal Planetdrupal.org/planet

NodeOne Bloggnodeone.se/blogg

Lullabotwww.lullabot.com/ideas/blog

#! codewww.hashbangcode.com

Extra Tips

If a user can't do something, check permissions

If the user can't edit a node or weird things are happening to the HTML then check the input filters

Make absolutely sure that the code you think is running is, in fact, running

Download modules and see how they did it

Don't be afraid of maintenance mode

Stay calm and clear cache

Bottom Line?

Drupal isn't hard, you just need to know what you are doing.

Which is the hard bit...

Questions?

Philip Nortonwww.hashbangcode.com

#!