7 to 8: Transitioning From theme() and Theme Functions to Render Arrays and Templates

Render arrays aren't new in Drupal 8. For years they have shared responsibility with theme() when rendering a page and everything in it. Don't call theme() in Drupal 8, though. It's gone. Render arrays are taking over and you should already be using them in Drupal 7.

Theme functions, such as theme_image() and theme_item_list(), are also losing the battle. They can still exist in Drupal 8, but templates and preprocess/process functions are far more common. Templates aren't new either, but like render arrays, they are far superior.

Start using both today. This session has your back. It will cover:

  • using render arrays instead of the theme() function
  • converting a theme function to a proper template and preprocess/process functions
  • the advantages of using each over their dying counterparts

About the presenter

Gus works for Chromatic and specializes in front-end development, but often finds himself involved with custom module development and general site building as well. He's a user experience fanatic with a great interest in a device-agnostic web. Gus also enjoys contributing back to the community.

Session track:

Session skill level:

Session speaker(s): 
Session date and time: 
Saturday, October 24, 2015 - 2:30pm

Session time slot:

Session files: 
PDF icon Slides for this session