Home

Lullabot

Lullabot Ideas

We know stuff. We empower you to know stuff too.

On Site Drupal Training

We'll come to you! Graduate from your own on-site courses and become Drupalistas!

Announcing Our Latest Video: Advanced Theming for Drupal

Article by Kent ByeJune 17, 2009 - 10:06am

Advanced Theming cover We're proud to announce the fifth video in the Lullabot Learning Series. Advanced Theming for Drupal, which picks up where the Drupal Theming Basics video lets off.

Here's the description:
The Lullabot Learning Series continues with an in-depth look at the advanced features of Drupal's theming system. In this 2-hour video Nate Haug, Jeff Robbins, and James Walker explain how to completely control the HTML markup Drupal generates. You'll learn how to modify and add variables sent to Drupal's template files and how to use the Theme Developer Tool to simplify the task of working with and navigating Drupal's complex theme system.

The video includes a crash course through PHP, then dives into advanced theming concepts with practical examples such as: how to theme forms, how to cleanly expose information to the theme system, and how to empower your site administrators by making certain parts of the theme available to them for customization. Lastly, the team covers security best practices on shows how to best sanitize user-submitted data and prevent security exploits.

This video completely implements our freely available 960 Robots theme, and gives you the tools you need to make your Drupal site no longer look like a Drupal site.

You can read the full description on store.lullabot.com.

In the following free sample chapter from the video, Nate Haug gives an overview of the template.php file and sets the stage for the specific examples that are provided throughout the course of the video:

The download version of Advanced Theming for Drupal is available right now in our store. You can find out more information and see another sample video that gives an overview of everything that's covered.

Comments

Roger (not verified) on June 29, 2009 - 10:28pm

Thanks for 960 Robots Theme

I've been having a great time customizing your 960 Robots Theme for my new site photoshopisland.com. It's still a work in progress but I plan on an official launch in a week or so. I should purchase your training video as it may have eliminated some of the hours I've put in customizing. I may still buy it. Are you offering any specials currently? I own your other three videos...any discounts for previous buyers?

Jeff Robbins on July 6, 2009 - 3:28pm

Ugh!

Ugh! You should have gotten on our mailing list. We had a bit of a "private sale" over the weekend and sent out a discount coupon to everyone on the list.

I love the 960 Robots theme customization, by the way. Be sure to let us know when the site launches and we'll send out a Twitter message about it.

MikeQue (not verified) on July 23, 2009 - 9:18am

Real names

Nice work on the videos. (Unfortunately I didn't see that offer before buying a few, as the videos are quite expensive.)

The Advanced Theming video was just what I've been looking for to demystify a few things in Drupal. In fact, the example of changing how the user name displays was exactly a task I needed to complete.

However, I came across a bug I believe. I built a function as you had to change the display of the user name to the real name, but now if I am logged in with that name and try to submit a comment to a blog posting, I get an "You have to specify a valid author." error related to that. Do you get the same thing, or could I have done something else to mess it up?
best,
Mike

Anonymous (not verified) on October 30, 2009 - 3:18pm

Having the EXACT same issue

Having the EXACT same issue with "You have to specify a valid author" once I work with a modified hook_username in my theme. Did anyone find a fix or workaround for this issue?

chadhester (not verified) on October 30, 2009 - 3:44pm

FIXED

It appears that there are some flaws with using the user's "real name" field.

NOTE: Mad thanks (rb7) for this comment:
http://drupal.org/node/47308#comment-832715

Here is a version of my theme's theme_username function, if it helps anyone:

<?php
/**
* Implementation of theme_username()
*/
function MYTHEME_username($object) {

  if (
$object->uid && $object->name) {
   
profile_load_profile($object);
   
$rewriteName = $object->name;
   
//Try to gather the First and Last Name pair
   
if ( !empty($object->profile_firstname)) {
     
$rewriteName = $object->profile_firstname;
      if ( !empty(
$object->profile_lastname)) {
       
$rewriteName .= " " . $object->profile_lastname;
      }
    }
   
   
//Favor a Real Name field
   
if ( !empty($object->profile_realname)) {
     
$rewriteName = $object->profile_realname;
    }
   
   
// Shorten the name when it is too long or it will break many tables.
   
if (drupal_strlen($rewriteName) > 20) {
     
$name = drupal_substr($rewriteName, 0, 15) .'...';
    }
    else {
     
$name = $rewriteName;
    }

    if (
user_access('access user profiles')) {
     
$output = l(check_plain($name), 'user/'. $object->uid, array('attributes' => array('title' => t('View user profile.'))));
    }
    else {
     
$output = check_plain($name);
    }
  }
  else if (
$object->name) {
   
// Sometimes modules display content composed by people who are
    // not registered members of the site (e.g. mailing list or news
    // aggregator modules). This clause enables modules to display
    // the true author of the content.
   
if (!empty($object->homepage)) {
     
$output = l($object->name, $object->homepage, array('attributes' => array('rel' => 'nofollow')));
    }
    else {
     
$output = check_plain($object->name);
    }

   
$output .= ' ('. t('not verified') .')';
  }
  else {
   
$output = check_plain(variable_get('anonymous', t('Anonymous')));
  }

  return
$output;
}
?>

If the above code doesn't display well, check this out instead:
http://drupal.pastebin.com/f4a2c25e5

:)

- Chad

Anonymous (not verified) on August 15, 2009 - 12:14pm

Mixed up link?

The "read the full description" Link links to the "Theming Basics" product. Not the "Advanced". Intended?

About this 'bot

Kent Bye

Kent Bye graduated with an electrical engineering degree from Rose-Hulman Institute of Technology in 1998. He worked at Northrop Grumman as a radar systems engineer for five years where he developed simulation software programs and became well-versed in working with complex modular systems.

For the last 10 years, Kent has also produced and directed a number of different independent film projects...

more

Recent

Drupal Voices 160: Moshe Weitzman on Page Rendering in Drupal 7

Podcast 9.02.2010

Drupal Voices 159: John Albin Wilkins on Drupal 7 Theming

Podcast 9.01.2010

Drupal Voices 158: Emma Jane Hogbin on PHP for Designers

Podcast 8.31.2010

Command Line Basics: More Editing with Vi/Vim

Video 8.31.2010

Lullabot's Back to School Sale

Blog 8.30.2010

Popular

Drupal Voices 160: Moshe Weitzman on Page Rendering in Drupal 7

Podcast 9.02.2010

Drupal Voices 159: John Albin Wilkins on Drupal 7 Theming

Podcast 9.01.2010

Photo galleries with Views Attach

Article 6.01.2009

Announcing BeautyTips, a jQuery Tooltip Plugin

Article 10.20.2008

Install a Local Web Server on Ubuntu

Video 11.14.2007
 
  • Home
  • Services
  • Events
  • Ideas
  • Store

Connect the Bots:

Twitter Facebook YouTube blip.tv All Posts Newsletter
  • Ideas
  • Blog
  • Podcasts
  • Videos
  • About
  • Contact
  • Jobs
  • Services
    • Training
  • Events
    • Training Workshops
    • Other Events
    • Conferences
    • Calendar
  • Products
    • Videos
    • Books
    • Swag
  • Ideas
    • Blog
    • Podcast
    • Videos
  • About
    • Philosophy
    • Team
    • Presskit
  • Contact
    • General
    • Work Inquiries
    • Mailing List