Overriding themable output
Depending on how your site is configured, the HTML code that makes up each page in your site is compiled from the output of various Drupal
Beginners guide to overriding themable output
Drupal theming is based on the concept of overriding the output from Drupal core and modules. Instead of having to modify the module to
Introduction to PHP for theming
Teaching PHP is beyond the scope of the Drupal documentation, but this page will introduce you to some of the most basic techniques which
About overriding themable output
The following only applies when the default markup needs changes. This section can be skipped if the presentation is handled only through
Setting up variables for use in a template (preprocess and process functions)
The main role of the preprocessors is to set up variables to be placed within the template (.tpl.php) files. From Drupal 7 they apply to
Default baseline variables
The following are the baseline variables available to all template files. They are generated through the preprocessor function, template
Customizing and Overriding User Login page, Register, and Password Reset in Drupal 6 and 7
Customizing the user login, register, and password reset pages is fairly simple, and uses the following concepts:
How to add a "?destination=URL" to the request new password link
Problem 1:
Useful tutorials & links
On Drupal.org:
Example: Themable output
How to customize HTML for the search block
Identifying Core Components
A list of Drupal core components and how to override them.
Core Block CSS IDs
Drupal Core generates a number of blocks, each with a unique CSS ID. In Drupal 7, many of the core block IDs have changed so they more
Mission statement and highlighted region
Drupal 6.x
Primary and Secondary links renamed to Main and Secondary menu
Primary and Secondary links have been renamed to Main and Secondary menu. Themes which support these options will need to be updated to use
Taxonomy
Drupal offers Taxonomy, a core feature allowing users to tag content.
Unrendered taxonomy links no longer available as a separate variable in node.tpl.php files
In Drupal 6, node.tpl.php files could use the $taxonomy variable if they needed access to an array of unrendered taxonomy links associated
Menu theming
The new theme_links($variables) function in D7 receives only an associative array to build the entire link structure. As you can read in the
Overriding a menu in a block or template file
Menu Links
The theme registry for special cases
You should be familiar with the purpose of the theme registry before continuing on this page. The instructions here will cover how to
Working with template suggestions
Template suggestions are alternate templates based on existing .tpl.php files. These suggestions can be used when a specified condition is
Architectural view of theming
This page provides background information on the underlying architecture of theming. It will be of interest to people who need a deeper
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.