====== Theming ====== Theming is the work necessary to take total control of the output/layout coming from drupal, without using one of the pre-made themes alone. A new theme can use another theme as a base. It would probably be best to review the basic structure before starting, and then take a look at one or more themes located in the core drupal install. * [[http://drupal.org/node/171194|Overview of theme files]] ===== create the folder ===== create a folder to contain your theme here: /sites//themes/ ===== create a .info file ===== see http://drupal.org/node/171205 ===== .tpl.php files ===== Create a page.tpl.php file to style the main layout of your site. Then create a node.tpl.php file to control the content output coming from your nodes. If you create a custom content type, you can then control it by creating a node-.tpl.php file. ===== create a style.css file ===== This will control the visual layout of your site. ===== enable the theme ===== Once your theme is roughly set up, you need to enable it in the drupal admin, under Administer->Site Building->Themes. ===== clear-block ===== Drupal has a build in css fix for when you need a containing element to always extend to the size of the floated children. To use this, simply give the container a class of clear-block. This avoids the common fixes such as placing a div after the floated elements with "clear: both;". * see http://drupal.org/node/380906 ===== clearing the cache ===== Depending on the caching settings of your site, you many not see theming changes right after you make them. To fix this, you need to clear the cache at Administer->Site Configuration->Clear Cached Data I didn't install it, but there is supposed to be a Dev module that provides an easy link or something to do this faster. ===== External Links ===== * [[http://drupal.org/theme-guide|Theming Guide]] * [[http://drupal.org/node/17565|Theming nodes by content type]] * [[http://drupal.org/node/190815|info about core template files]] * [[http://drupal.org/node/19828|info about regions, blocks, etc...]] * [[http://drupal.org/node/21716|custom home pages]]