Core templates

Last updated on
30 November 2017

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

Core comes with a number of default template files. In order to override these templates, all you need to do is copy them into your theme folder and clear the theme registry.

You can also override these templates in a more targeted way. In Drupal 7, they need to be renamed to use a double-hyphen. For example, "node--article.tpl.php". A single hyphen is still used to separate words: for example, "user-picture.tpl.php" or "node--long-content-type-name.tpl.php", so the double hyphen always indicates a more targeted override of what comes before the "--".

See Converting 6.x themes to 7.x for more info.

Core templates

Default templates:

These are the default template (.tpl.php) files provided by core in Drupal 7. Documentation on the variables and purpose of these templates are located inside the templates. There is a default set of variables available to all templates.

Drupalize.Me offers a free, eight-minute video on the ins and outs of modifying template.php.

In order to override these templates, all you need to do is copy them into your theme folder and clear the theme registry.

To override templates in a more targeted way, see Drupal 7 Template Suggestions.

Aggregator

"modules/aggregator/..."

Block

"modules/block/..."

Note: the Drupal 6 version of block.tpl.php used to be part of "modules/system/...".

Book

"modules/book/..."

Comment

"modules/comment/..."

Note: comment-folded.tpl.php has been deprecated in Drupal 7.

Field

"modules/field/theme/..."

Note: field.tpl.php is a new template in Drupal 7.

Forum

"modules/forum/..."

Note: forum-topic-navigation.tpl.php has been deprecated in Drupal 7.

Node

"modules/node/..."

Overlay

"modules/overlay/..."

Note: overlay.tpl.php is a new template in Drupal 7.

Poll

"modules/poll/..."

Note: Former templates poll-results-block.tpl.php and poll-bar-block.tpl.php have been renamed with a double dash in Drupal 7.

Profile

"modules/profile/..."

Search

"modules/search/..."

Note: search-theme-form.tpl.php has been deprecated in Drupal 7.

System

"modules/system/..."

Note: box.tpl.php has been deprecated in Drupal 7. html.tpl.php and region.tpl.php have been added.

Taxonomy

"modules/taxonomy/..."

Note: taxonomy-term.tpl.php is a new template in Drupal 7.

Toolbar

"modules/toolbar/..."

Note: toolbar.tpl.php is a new template in Drupal 7.

User

"modules/user/..."

Help improve this page

Page status: No known problems

You can: