| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 <?php 2 // $Id: template.php,v 1.1 2009/08/14 09:06:19 kehan Exp $ 3 4 /** 5 * @file 6 * Contains theme override functions and preprocess functions for the theme. 7 * 8 * ABOUT THE TEMPLATE.PHP FILE 9 * 10 * The template.php file is one of the most useful files when creating or 11 * modifying Drupal themes. You can add new regions for block content, modify 12 * or override Drupal's theme functions, intercept or make additional 13 * variables available to your theme, and create custom PHP logic. For more 14 * information, please visit the Theme Developer's Guide on Drupal.org: 15 * http://drupal.org/theme-guide 16 * 17 * OVERRIDING THEME FUNCTIONS 18 * 19 * The Drupal theme system uses special theme functions to generate HTML 20 * output automatically. Often we wish to customize this HTML output. To do 21 * this, we have to override the theme function. You have to first find the 22 * theme function that generates the output, and then "catch" it and modify it 23 * here. The easiest way to do it is to copy the original function in its 24 * entirety and paste it here, changing the prefix from theme_ to gbif_. 25 * For example: 26 * 27 * original: theme_breadcrumb() 28 * theme override: gbif_breadcrumb() 29 * 30 * where gbif is the name of your sub-theme. For example, the 31 * zen_classic theme would define a zen_classic_breadcrumb() function. 32 * 33 * If you would like to override any of the theme functions used in Zen core, 34 * you should first look at how Zen core implements those functions: 35 * theme_breadcrumbs() in zen/template.php 36 * theme_menu_item_link() in zen/template.php 37 * theme_menu_local_tasks() in zen/template.php 38 * 39 * For more information, please visit the Theme Developer's Guide on 40 * Drupal.org: http://drupal.org/node/173880 41 * 42 * CREATE OR MODIFY VARIABLES FOR YOUR THEME 43 * 44 * Each tpl.php template file has several variables which hold various pieces 45 * of content. You can modify those variables (or add new ones) before they 46 * are used in the template files by using preprocess functions. 47 * 48 * This makes THEME_preprocess_HOOK() functions the most powerful functions 49 * available to themers. 50 * 51 * It works by having one preprocess function for each template file or its 52 * derivatives (called template suggestions). For example: 53 * THEME_preprocess_page alters the variables for page.tpl.php 54 * THEME_preprocess_node alters the variables for node.tpl.php or 55 * for node-forum.tpl.php 56 * THEME_preprocess_comment alters the variables for comment.tpl.php 57 * THEME_preprocess_block alters the variables for block.tpl.php 58 * 59 * For more information on preprocess functions and template suggestions, 60 * please visit the Theme Developer's Guide on Drupal.org: 61 * http://drupal.org/node/223440 62 * and http://drupal.org/node/190815#template-suggestions 63 * 64 * SEE THE STARTERKIT zen SUBTHEME FOR FURTHER HOOKS THAT ARE AVAILABLE. 65 */ 66 67 /** 68 * Implementation of HOOK_theme(). 69 */ 70 function gbif_theme(&$existing, $type, $theme, $path) { 71 $hooks = zen_theme($existing, $type, $theme, $path); 72 // Add your theme hooks like this: 73 /* 74 $hooks['hook_name_here'] = array( // Details go here ); 75 */ 76 return $hooks; 77 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |