Integrating with the theme system

Video loading...

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,

Module Development for Drupal 7

Loading ...

Integrating with the Theme System

Loading...

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.

Downloads: 
Log in or sign up to download companion files.
Additional resources: 

Average review

0
No votes yet

Reviews