Theme Changes between Drupal 6 and Drupal 7

 

Drupal 7 is coming, like it or not! With the upcoming release, many theme designers are anxious to know what they'll have to do to migrate their existing Drupal 6-compatible themes to make them work with Drupal 7. Here are the changes I found most interesting:

jQuery UI 1.7 is in Core!

No more need for the jquery_ui module; you can simply user drupal_add_js() with the path of the included JavaScript file, which lives at misc/js.

These Aren't Your Mother's Blocks

  • $content is now mandatory in all themes (it's a full region in Drupal 7.)
  • Main page content is now a block... watch out, because it's wrapped in a CSS .block class!
  • $left and $right variables are now $sidebar_first and $sidebar_second
  • Blocks defined by Drupal core have more meaningful CSS IDs, like block-profile-author-information instead of Drupal 6's block-profile-0
  • $block->content is now just $content in block.tpl.php

Mission Statement, Footer and $closure have been removed

$closure becomes $page_bottom, and a new $page_top must be placed at the beginning of the HTML body.

Improved Accessability

Drupal will be more accessible than ever to users who rely on screen readers. Check it out:

  • Installation task progress bars are accessible with a screen reader, not just through CSS.
  • There's a new description of the breadcrumbs so that screen readers will read out "You are here" before parsing the breadcrumbs, to give users context that was previously only presented visually.
  • Theme_links() now accepts a header attribute, to conform to the Web Content Accessibility Guidelines for content sections.
  • New CSS system classes .element-hidden and .element-invisible have been added to hide elements in an accessible manner.

PHPTemplate Wildcards

No more writing a bunch of page-user.tpl.php and page-user-1.tpl.php... in Drupal 7, you can insert a wildcard like so: page-user-%.tpl.php. Voila!

What are you most concerned about as you transition to Drupal 7?

Post your comments below.

For the full list of changes, check out the d.o article at http://drupal.org/update/theme/6/7.

1 Comment

Thanks for a good overview

Thanks for a good overview Dave. Answering your question, I am mostly concerned with the API changes and the theme_preprocess changes. I expect it to be more powerful with D7 possibly, demanding to take another step up the curve.

Did you enjoy this post? Please spread the word.