Blog posts in: advanced

Advanced Drupal Theming using Panels Part 1: Embracing Panels style plugins and writing your own.

I generally would style individual page elements like menus, blocks, views, and other content by using their own class names or IDs. That would mean if I wanted a consistent style to be applied to many of these elements I would have to override template files just to add a consistent class attribute, or have multi-line selectors in my css which would make it incredibly difficult to organize.

Change the execution order of $(document).ready()

If you use jQuery in development, you've almost definitely used $(document).ready(). $(document).ready() is a wonderful function that lets you run Javascript code as the page is ready to handle it. But one potentially frustrating aspect of it is that functions are executed in the same order they're passed in, and jQuery doesn't let you choose which functions run first.

Usually, this is fine, but every once in a while, you really want your function to run before another function. For example, if your page is running jCarousel or Google Maps, or any other library that changes the markup of your page, you might want to do some processing before they get a chance. With the traditional $(document).ready(), you'd be out of luck.

The hidden menu paths in Devel you may not know about

Devel is a supremely useful module for Drupal development, but if you've never enabled the Development menu block, there are some useful links you might be missing out on. Here are some features of Devel that you might not know about:

Execute PHP
Path: devel/php
Provides a text area for entering PHP code into. Any output (print, print_r, var_dump) is shown in a drupal_set_message.

PHP Info
Path: devel/phpinfo
Get PHP configuration info from the server your site is running on.

View Theme Registry
Path: devel/theme/registry
Get down deep with the theme info your Drupal site knows about. Great for expert themers.

Syndicate content