theming

10 Things That Make Front End Drupal a Must-Have Book

Published December 1, 2009

Several months ago Ryan Price interviewed Emma Jane Hogbin, one of the authors of Front End Drupal, for DrupalEasy Podcast 10. At the time I hadn't received a review copy of the book, so I made a mental note to check out the book based on the interview. Six months later, the folks at Prentice Hall were kind enough to send me a copy, and I was not disappointed. Emma Jane Hogbin and Konstantin Kafer have written Front End Drupal in a way that makes it a valuble resource for virtually anyone who uses Drupal in one form or another. The strength of the book lies in the fact that it explains core concepts and best practices of how sites are built in Drupal, with an empahsis on theming. Rather than writing a full-on review for a book that has already been reviewed more than a couple of times elsewhere, I thought that I'd provide a list of 10 things that this book covers really well.

Internet Explorer CSS File Limits

Published August 13, 2009

When creating a theme, it is often very handy to break up the CSS into multiple files for the purpose of keeping things better organized. Luckily, Drupal has built-in CSS optimization on the admin/settings/performance page, but during development it is sometime quite easy to run up a large number of CSS files being used.

Theming Submit Buttons

Published August 11, 2009

Need an fast way to theme a submit button on your site? Using one hook_form_alter() function and some simple CSS, it's fairly easy to do.

The method below actually keeps the text of the button as text and not part of the image (this allows you to reuse the button image for multiple buttons), but you can just as easily set the #value attribute to '' to get rid of the text.

You'll use hook_form_alter() to simply add a CSS class to the button you want to theme and to modify the text of the button.

Theming Nodereference - or - Reusing Complex Data in Drupal

Published August 1, 2009

This is your moment, you've decided to step up and make a job board for your local Drupal User Group. You spend some time thinking about everything you'll need, including the job listings themselves. You'll want to gather the standard info, like job title and job description, salary, experience, the works. When it comes to gathering company info, your instincts make you take a few extra moments to plan. If you think about this from the perspective of the person posting 6 or 7 jobs, she would end up having to type (or at least copy and paste) the business' contact information each time. If you think about collecting 3 or 4 fields for each business, then that's about 20 extra form fields for the user to fill out. If she then decides to change the info, let's say she made a typo, she now must click through each edit screen 6 or 7 times. That amounts to hundreds of clicks and several hundred repeated keystrokes. There must be a better way. A nodereference can help your users. Once finished, you will have two nodes, one for a job and another for a company, and yet you will still display the information about the company inside the job listing. By the end of this tutorial, you should understand what a nodereference is for, how to create and use one, and finally, how to use template files to theme the output of the nodereference and get the most out of the relationship.

Getting Started with the 960 Grid System

Published June 25, 2009

If you've been following along with recent Drupal news, then you've probably heard about the 960 Grid System for laying out web pages. The associated Drupal starter theme, NineSixty was one of the stars of the recent Design 4 Drupal camp in Boston and is making some headway into possibly finding its way into Drupal 7 core.

If you want to get kick-started on learning about 960, here are some great resources: