Skip to Content

You are here

52 Changes in Drupal 7 Theme structure

1. more Meaning full IDS are used.
example :
Recent blog posts
Old CSS ID (Drupal 6): block-blog-0
New CSS ID (Drupal 7): block-blog-recent

similarly for following,
Book navigation
Old CSS ID (Drupal 6): book = navigation
Recent comments
Active forum topics
New forum topics
Language switcher
Syndicate
Most recent poll
Author information
Search form :
Popular content :block-statistics-popular
Powered by Drupal :block-system-powered-by
User login : block-user-login
Navigation : block-system-navigation
Who's new : block-user-new
Who's online : block-user-online

2. Primary and secondary links are now Main and Secondary menu

6.x: theme.info - features[]
features[] = primary_links
features[] = secondary_links

7.x: theme.info - features[]
features[] = main_menu
features[] = secondary_menu

3. Unrendered taxonomy links are no longer available as a separate variable in node.tpl.php files.

<?php if ($terms): ?>
<?php print $terms ?>
<?php endif;?>

4. RDFa requires some changes at the beginning of html.tpl.php

language ?>" dir="<?php print $language->dir ?>"
<?php print $rdf_namespaces ?>>
">

5. The clear-block class has been renamed to clearfix

The “clear-block” class was a Drupalism for functionality that was better known by the CSS Community as the “clearfix” class. Also, using “block” in the old name was confusing to Drupal users more familiar with Drupal’s block system than with the properties inside that CSS ruleset. New themers and designers to the Drupal community will no longer be confused by the old class name.

If you had a in your D6 theme, simply change it to .

6. The box.tpl.php template has been removed

7. $help became a region

8. Mission statement removed, 'highlighted' region suggested

9. Footer message removed

10. Content region is now mandatory, main page content became a block

11. Second phase variable process functions

12. HTML classes generated through a variable
<?php
function mytheme_preprocess_node(&$vars) {
// Add a striping class.
$vars['classes_array'][] = 'node-' . $vars['zebra'];
}
?>
">
...

13. HTML attributes generated through a variable

14. Variable process functions can now be used for all theming hooks

15. All theme functions now take a single argument, $variables

16. Function names must match theme name

17. All CSS and JavaScript files must be specified in the theme's .info file

18. Renamed $block->content to $content in block.tpl.php

19. Granular rendering in node and user templates.

20. Added jQuery UI (1.8) to core

21. Attached JavaScript and CSS for drupal_render

22. $closure becomes $page_bottom, new $page_top and hidden regions

23. $left and $right variables are now $sidebar_first and $sidebar_second; CSS IDs also changed

24. $picture changes to $user_picture, and the CSS class 'picture' to 'user-picture'

25. New classes available to hide content in an accessible manner

26. JavaScript variable Drupal.jsEnabled has been removed

27. PHPTemplate suggestion wildcard

28. Include theme definition explicitly on element when using system_elements()

29. Added markup to make installation task progress perceivable with screen-reader and CSS disabled

30. Add an invisible heading to theme_breadcrumb()

31. Changes to alt and title attribute for the RSS feed icon

32. Search box moved from theme layer to blocks

33. Changes to menu tree, link and tab rendering functions

34. theme_links() has a new parameter $heading for accessibility

35. theme_get_setting() and THEME_settings() have been improved

36. theme_form_required_marker()

37. theme_link()

38. Skip to main content links in core themes

39. Alter hooks available to themes

40. System module stylesheets have been reorganized to separate behavior-supporting styles from presentational styles.

41. New theme setting for displaying the Shortcut module "add to shortcuts" link

42. Specific template overrides of generic templates use a '--' delimiter instead of '-'

43. CSS files are sometimes loaded with @import, sometimes with LINK tags

44. Browser-targeted CSS files can and should be added using drupal_add_css()

45. Targeted overrides (suggestions) available for theme_menu_link() and theme_menu_tree()
theme_submenu() was removed
46. New $title_prefix and $title_suffix template variables

47. theme_node_form() was removed

48. node_get_types() renamed to node_type_get_types()

49. Core themes now contain "package = Core" in their .info files

50. search-result.tpl.php now uses proper H3 headings for search result titles

51. The name attribute in a and map elements is invalid

52. PHPTemplate is now the default theme engine