O'Reilly logo

Drupal 7 Module Development by Ken Rickard, John Wilkins, Larry Garfield, Matt Butcher, Greg Dunlap, Matt Farina

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Steps to build a default theme implementation

Okay, now it's time to exorcise our lazy-developer habit and practice building our own theme hook. From Chapter 3, you should recall that we'll need to do the following things:

  1. Register the theme hook and define default variables.
  2. Build the default implementation of our theme hook.
  3. Re-build the theme registry.
  4. Build a render element to use the theme hook.

Our current implementation of the Recent blog posts block simply shows a list of blog titles. But it would be nice to include the date of each post, as well as the author (if we have multiple people creating posts). So in this third and final version of our module, we're going to create a single-blog-block-item.tpl.php to render the contents of each item ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required