An Introduction to Theme Hooks That’ll Get You Using Them in No Time

amani.mansour

Hooks are used to alter and extend the core behavior of Drupal. When working on a Drupal site, there are many times that you need to render data on a page, but that piece of data is not easily accessible. Or there are times when you need to create a template file for a particular subset of nodes but the theme’s template suggestions are not unique enough. Theme hooks can be used to retrieve or alter data, allowing you to determine how data should be rendered to meet design and functionality requirements.

In this session we will –

  • Cover what hooks are and how they are used

  • Provide a cheat sheet of the most commonly used theme hooks, explaining what they do and when to use them

  • Provide real-life examples with code samples that demonstrate how to implement hooks

 

Sessions attendees will come away with not only a better understanding of the concept of hooks, but also with the ability to implement the most useful hooks on their next project.

 

 

Program tags

php

Experience Level

Beginner

Drupal Version