Warning message

Documentation is currently being migrated into the new system. Some pages might be temporarily missing, and some guides might appear empty. Thank you for your patience while we are improving Drupal.org documentation.

Core templates

Last updated on
December 4, 2016 - 02:21

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/..."