Drupal 6 Theming Cheat Sheet
Drupal 6 Theming Cheat Sheet
Drupal 6 Theming Cheat Sheet
Common Template Files (http://drupal.org/node/171194) Filename Description [themename].info Meta data, style sheets, JavaScripts, block (required) regions and more can be defined here. page.tpl.php main template file, controls the display of most content template.php all the conditional logic and data processing of the output screenshot.png thumbnail screenshot of the theme logo.png graphic file of the site's logo node.tpl.php controls node display block.tpl.php controls block display comment.tpl.php controls comment display box.tpl.php obscrure and rarely used page-front.tpl.php used to display a custom front page Nodetype Template Files (http://drupal.org/node/190815) node-[nodetype].tpl.php
URL Based Template Files (http://drupal.org/node/190815) (ex: http://www.example.com/node/1/edit) page-node-edit.tpl.php page-node-1.tpl.php page-node.tpl.php page.tpl.php Block Template Files (http://drupal.org/node/190815) block-[module]-[delta].tpl.php block-[module].tpl.php block-[region].tpl.php block.tpl.php
Page.tpl.php Code (http://api.drupal.org/api/file/modules/system/page.tpl.php/6/source) adapted from: http://www.nerdliness.com/article/2007/09/10/drupal-theming <head> Head <title><?php print $head_title; ?></title> <?php print $head; ?> <?php print $styles; ?> <?php print $scripts; ?> <script type="text/javascript"><?php /* Needed to avoid Flash of Unstyled Content in IE */ ?> </script> </head> <?php if (!empty($search_box)): ?> Search Box <?php print $search_box; ?> <?php endif; ?> <?php if (!empty($logo)): ?> Logo <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo"> <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" /> </a> <?php endif; ?> <?php if (!empty($site_name)): ?> Site Name <h1 id="site-name"> <a href="<?php print $front_page ?>" title="<?php print t('Home'); ?>" rel="home"> <span><?php print $site_name; ?></span> </a> </h1> <?php endif; ?> <?php if (!empty($site_slogan)): ?> Site Slogan <?php print $site_slogan; ?> <?php endif; ?> <?php if (!empty($primary_links)): ?> Main Navigation <?php print theme('links', $primary_links, array('class' => 'links primary-links')); ?> <?php endif; ?> <?php if (!empty($header)): ?> Header Content <?php print $header; ?> <?php endif; ?> <?php if (!empty($left)): ?> Left Sidebar <?php print $left; ?> <?php endif; ?> <?php if (!empty($right)): ?> Right Sidebar <?php print $right; ?> <?php endif; ?> <?php if (!empty($title)): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?> Main Content <?php if (!empty($tabs)): ?><div class="tabs"><?php print $tabs; ?></div><?php endif; ?> <?php if (!empty($messages)): print $messages; endif; ?> <?php if (!empty($help)): print $help; endif; ?> <?php print $content; ?> <?php print $feed_icons; ?> <?php print $footer_message; ?> Footer <?php if (!empty($footer)): print $footer; endif; ?> <?php print $closure ?> Closing HTML </body> </html> Reference Links: Drupal 6 theme guide How I converted my HTML template into a Drupal 6 theme Theme developer module for Drupal 6 - Screencast Overriding functions Themeable functions Assigning content to regions Theming Views 2 The Basics Create A Base Style.css File Default baseline variables (available to all template files) Devel module
http://drupal.org/theme-guide/6 http://drupaltherapy.com/node/52 http://drupal.org/node/209561 http://drupal.org/node/173880#function-override http://api.drupal.org/api/group/themeable http://drupal.org/node/171224 http://www.group42.ca/theming_views_2_the_basics http://mydrupalblog.lhmdesign.com/create-base-style-css-file http://drupal.org/node/226776 http://drupal.org/project/devel