Tech

print yarrr!

Webchick cornered me tonight and asked me to take a look at an interesting patch that affects themers: Allow more granular theming of drupal_rendered elements. The short version is that if the patch is applied all template files will need to be updated from:

print $content

to

print r($content)

The new "yarr" function will allow you to render the variable from within the template. This means you will be able to extract specific fields from the "whole" content variable and style them differently (y'know, like an image that ought to be floated to the right). It also means that you can actually use the variable $content instead of just chucking it and having to style each field individually because you want a variable to have a unique HTML wrapper/CSS style applied.

Overall I think the patch is a good suggestion. I have only one concern: print_r and print r are very different, but look similar. I'd hate to have to teach a class where I say, "print r" and explain why that is completely different and in no way related to "print_r."

Is this being too picky? What do you think? Please leave your comments IN THE ISSUE QUEUE and help make Drupal 7 even more awesome for themers and future themers! (And thanks to the developers for looking out for us.)

Git for Teams

Git For Teams

Best selling title from O'Reilly media. Covers essential skills needed to use Git in a team environment.

Available from O'Reilly media, and better bookstores worldwide.

Collaborating with Git

Collaborating with Git

Practical how-to videos to get you, and your team, up and running with Git. A complementary video series for the book, Git for Teams.

Available from O'Reilly media.

Drupal User's Guide

Drupal User's Guide

Site building for Drupal 7. Includes in-depth information on Drupal's most popular site building modules, SEO and accessibility. Two complete case studies are included in the book along with the tools you'll need to build (almost) any Web site with Drupal.

Available from Amazon.com.

Front End Drupal

Front End Drupal

The industry go-to for learning theming in Drupal 6. A great companion to Lullabot's book, Using Drupal.

Available from Amazon.com.