Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Alternate resources: 

Integrating with the theme system

Video loading...

Transcript language code: 

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:08
    In the previous chapter, we took a look at using
  • 0:10
    renderable arrays in conjunction with Drupal's already existing
  • 0:13
    theme functions to output content from our module to the page in a way
  • 0:17
    that could be overridden by either the theme or another module.
  • 0:21
    Theme functions are what Drupal uses
  • 0:22
    in order to translate the renderable arrays into the actual HTML,
  • 0:27
    that's return to the browser, and thus displayed on the page.
  • 0:30
    So as module developers, it's really important for us
  • 0:33
    to return our content in a way that can be overridden by the theme.
  • 0:37
    We want it to eventually be turned into HTML,

Integrating with the Theme System


This video shows how a module can integrate with Drupal's theme system by exposing a new themeable item to the theme registry with hook_theme(), and then creates a function in order the customize the output of that themeable item. The then video demonstrates how the theme layer can override the markup defined with theme functions at the module layer.

Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.