Drupal 7 Theming Cheat Sheet
Compiled by: Dale Brendan
block.tpl.php variables $block_html_id $block_id $block_zebra $block->delta $block->module $block->region $content $classes $classes_array $id $is_admin $is_front $logged_in $title $title_prefix $title_suffix
A unique HTML id. Incremental position of the block. Increases each output. Outputs either odd or even for each block region. An ID for the block. The module that generated the block. The block region embedding the current block. The content of the block. String of CSS classes. Array of HTML class attribute values. Same as $block_id, but independent of any block region. TRUE when the current user is an administrator. TRUE if the current page is the front page. TRUE when the current user is logged in. The title of the block. Array containing output prepended by modules. Array containing output appended by modules.
comment.tpl.php variables $author $changed $classes $content $created $new $permalink $picture $signature $status $submitted $title $title_prefix $title_suffix
The author of the comment. Formatted date and time of when the comment was updated. String of CSS classes. An array of comment items. Formatted date and time of when the comment was created. New comment marker. Link directly to a specific comment. The author's picture. The author's signature. The status of the comment (published, unpublished, preview) Submission information of both the author and creation date. The linked title of the comment. Array containing output prepended by modules. Array containing output appended by modules.
html.tpl.php variables $classes $css $rdf_namespaces $grddle_profile $head $head_title $head_title_array $language $language->language $language->dir $page_top $page $page_bottom $styles $scripts
String of CSS classes. An array of CSS files for the current page. All RDF namespace prefixes used in the HTML document. A GRDDL profile allowing agents to extract RDF data. Markup for the HEAD section, including: meta, keywords, etc. Displays the site name and page title in the head of the document. An array containing the string parts used to construct the $head_title. The language object in which the site is being displayed. The textual representation of the display language. For example, en or es . Whether the display language is left to right or right to left . Initial markup for mockups that alter the page. Must be output first. The rendered page content. Final closing markup from modules that altered the page. Output last. Style tags necessary to import all CSS files for the page. Script tags needed to loaded all javascript files and settings for the page.
node.tpl.php variables $classes $classes_array $comment
String of CSS classes. Array of HTML class attribute values. Flag for the comment settings of the node.
$comment_count $content $created $date $display_submitted $id $is_admin $is_front $logged_in $name $node $node_url $page $promote $status $sticky $submitted $readmore $teaser $terms $title $title_prefix $title_suffix $type $uid $user_picture $view_mode $zebra
The number of comments attached to the node. An array of node items. Time the node was published formatted as a Unix timestamp. The formatted creation date of the node. Whether submission information should be displayed. Incremental position of the node. Increases each output. TRUE when the current user is an administrator. TRUE if the current page is the front page. TRUE when the current user is logged in. The themed username of the node authour. The full node object. The URL of the current node. Flag for the full state of the page. Whether the node is flagged for promote to front page . Whether the node is flagged as published . Whether the node is flagged sticky . Submission information created from $name and $date. TRUE if the teaser content cannot hold the main body content. Flag for the teaser state of the node. The themed list of taxonomy terms. The title of the node. Array containing output prepended by modules. Array containing output appended by modules. The node type. The User ID of the node's author. The node author's picture. Whether the node is being viewed in full or teaser mode. Outputs either odd or even for every other node.
maintenace.tpl.php variables *Identical to page.tpl.php variables page.tpl.php variables $action_links $base_path $breadcrumb $directory $is_admin $is_front $feed_icons $front_page $highlight $logged_in $logo $main_menu $messages $node $secondary_menu $site_name $site_slogan $tabs $title_prefix $title $title_suffix
Actions local to the page. The base URL path of the Drupal install. The breadcrumb trail for the current page. The directory in which the template is located. TRUE when the current user is an administrator. TRUE if the current page is the front page. A string of feed icons for the current page. The URL of the front page. Replaces the $mission variable. TRUE if the user is registered and signed in. The path to the logo image. An array containing all main menu links. HTML for status and error messages. The node object. An array containing all secondary menu links. The name of the website. The slogan of the website. Tabs linking to sub-pages beneath the current page. Array containing output prepended by modules. The page title. Array containing output appended by modules.
region.tpl.php variables $content
The content for this region, typically blocks.
$classes $region $classes_array $is_admin $is_front $logged_in
A string of CSS classes. The name of the region as defined in the .info file. Array of html class attribute values. TRUE when the current user is an administrator. TRUE if the current page is the front page. TRUE if the user is registered and signed in.
Drupal Template Files aggregator-feed-source.tpl.php aggregator-item.tpl.php aggregator-summary-item.tpl.php aggregator-summary-items.tpl.php aggregator-wrapper.tpl.php block.tpl.php block-admin-display-form.tpl.php block--[region].tpl.php book-all-books-block.tpl.php book-export-html.tpl.php book-navigation.tpl.php book-node-export-html.tpl.php comment.tpl.php comment-wrapper.tpl.php field.tpl.php forums.tpl.php forum-icon.tpl.php forum-list.tpl.php forum-submitted.tpl.php forum-topic-list.tpl.php html.tpl.php maintenance-page.tpl.php node.tpl.php node--[content-type].tpl.php page.tpl.php page--front.tpl.php page--node-[#].tpl.php poll-bar.tpl.php poll-bar--block.tpl.php poll-results.tpl.php poll-results--block.tpl.php poll-vote.tpl.php profile-block.tpl.php profile-listing.tpl.php profile-wrapper.tpl.php region.tpl.php search-block-form.tpl.php search-result.tpl.php search-results.tpl.php taxonomy-term.tpl.php theme.info toolbar.tpl.php user-picture.tpl.php user-profile.tpl.php user-profile-category.tpl.php user-profile-item.tpl.php
Template to present the source of the feed. Template to format an individual feed item. Template to present a linked feed item for summaries. Template to present feeds as list items. Template to wrap aggregator content. Template for displaying block content. Template to configure blocks. Template for a block in a specific region. Two -- for Drupal 7. Template for rendering book outlines within a block. Template for printed version of the book online. Template to navgate books. Template for rendering a single node in a printer friendly outline. Template for displaying comment content. Template to provide an HTML container for comments. Template to display the value of a field. Template to display a forum which may contain containers and topics. Template to display an appropriate icon for a forum post. Template to display a list of forums and containers. Template to format a single string displaying the author and time of post. Template to display a list of forum topics. Page wrapper for your theme containing <html> open, closing, etc tags. Template to display a single Drupal page when the website is offline. Template for displaying node content. Template for displaying a node of a specific content type. Two -- for Drupal 7. Template for displaying page content. Template for the front page of the website. Two -- for Drupal 7. Template for displaying a node of a specific ID. For example, node/10. Template to display the bar for a single choice in a poll. Template to display the bar for a choice in a poll when displayed in a block. Template to display the poll results. Template to display poll results in a block. Template for displaying a voting form for a poll. Template for displaying user profiles within a block. Template for displaying a user and their data for member listing pages. Template for wrapping member listings and their profiles. Template for displaying region content. Template for displaying the search form block. Template for displaying a single search result. Template for displaying search results. Template for displaying a taxonomy term. Stores meta data about the theme. Template for displaying the admin toolbar. Template for presenting a user's account picture. Template for displaying a user's profile data. Template for displaying profile categories. Template for presenting profile values from profile fields or modules.