root / drupal7 / sites / all / themes / zen / STARTERKIT / template.php @ 4da4932d
1 |
<?php
|
---|---|
2 |
/**
|
3 |
* @file
|
4 |
* Contains the theme's functions to manipulate Drupal's default markup.
|
5 |
*
|
6 |
* Complete documentation for this file is available online.
|
7 |
* @see https://drupal.org/node/1728096
|
8 |
*/
|
9 |
|
10 |
|
11 |
/**
|
12 |
* Override or insert variables into the maintenance page template.
|
13 |
*
|
14 |
* @param $variables
|
15 |
* An array of variables to pass to the theme template.
|
16 |
* @param $hook
|
17 |
* The name of the template being rendered ("maintenance_page" in this case.)
|
18 |
*/
|
19 |
/* -- Delete this line if you want to use this function
|
20 |
function STARTERKIT_preprocess_maintenance_page(&$variables, $hook) {
|
21 |
// When a variable is manipulated or added in preprocess_html or
|
22 |
// preprocess_page, that same work is probably needed for the maintenance page
|
23 |
// as well, so we can just re-use those functions to do that work here.
|
24 |
STARTERKIT_preprocess_html($variables, $hook);
|
25 |
STARTERKIT_preprocess_page($variables, $hook);
|
26 |
}
|
27 |
// */
|
28 |
|
29 |
/**
|
30 |
* Override or insert variables into the html templates.
|
31 |
*
|
32 |
* @param $variables
|
33 |
* An array of variables to pass to the theme template.
|
34 |
* @param $hook
|
35 |
* The name of the template being rendered ("html" in this case.)
|
36 |
*/
|
37 |
/* -- Delete this line if you want to use this function
|
38 |
function STARTERKIT_preprocess_html(&$variables, $hook) {
|
39 |
$variables['sample_variable'] = t('Lorem ipsum.');
|
40 |
|
41 |
// The body tag's classes are controlled by the $classes_array variable. To
|
42 |
// remove a class from $classes_array, use array_diff().
|
43 |
//$variables['classes_array'] = array_diff($variables['classes_array'], array('class-to-remove'));
|
44 |
}
|
45 |
// */
|
46 |
|
47 |
/**
|
48 |
* Override or insert variables into the page templates.
|
49 |
*
|
50 |
* @param $variables
|
51 |
* An array of variables to pass to the theme template.
|
52 |
* @param $hook
|
53 |
* The name of the template being rendered ("page" in this case.)
|
54 |
*/
|
55 |
/* -- Delete this line if you want to use this function
|
56 |
function STARTERKIT_preprocess_page(&$variables, $hook) {
|
57 |
$variables['sample_variable'] = t('Lorem ipsum.');
|
58 |
}
|
59 |
// */
|
60 |
|
61 |
/**
|
62 |
* Override or insert variables into the node templates.
|
63 |
*
|
64 |
* @param $variables
|
65 |
* An array of variables to pass to the theme template.
|
66 |
* @param $hook
|
67 |
* The name of the template being rendered ("node" in this case.)
|
68 |
*/
|
69 |
/* -- Delete this line if you want to use this function
|
70 |
function STARTERKIT_preprocess_node(&$variables, $hook) {
|
71 |
$variables['sample_variable'] = t('Lorem ipsum.');
|
72 |
|
73 |
// Optionally, run node-type-specific preprocess functions, like
|
74 |
// STARTERKIT_preprocess_node_page() or STARTERKIT_preprocess_node_story().
|
75 |
$function = __FUNCTION__ . '_' . $variables['node']->type;
|
76 |
if (function_exists($function)) {
|
77 |
$function($variables, $hook);
|
78 |
}
|
79 |
}
|
80 |
// */
|
81 |
|
82 |
/**
|
83 |
* Override or insert variables into the comment templates.
|
84 |
*
|
85 |
* @param $variables
|
86 |
* An array of variables to pass to the theme template.
|
87 |
* @param $hook
|
88 |
* The name of the template being rendered ("comment" in this case.)
|
89 |
*/
|
90 |
/* -- Delete this line if you want to use this function
|
91 |
function STARTERKIT_preprocess_comment(&$variables, $hook) {
|
92 |
$variables['sample_variable'] = t('Lorem ipsum.');
|
93 |
}
|
94 |
// */
|
95 |
|
96 |
/**
|
97 |
* Override or insert variables into the region templates.
|
98 |
*
|
99 |
* @param $variables
|
100 |
* An array of variables to pass to the theme template.
|
101 |
* @param $hook
|
102 |
* The name of the template being rendered ("region" in this case.)
|
103 |
*/
|
104 |
/* -- Delete this line if you want to use this function
|
105 |
function STARTERKIT_preprocess_region(&$variables, $hook) {
|
106 |
// Don't use Zen's region--sidebar.tpl.php template for sidebars.
|
107 |
//if (strpos($variables['region'], 'sidebar_') === 0) {
|
108 |
// $variables['theme_hook_suggestions'] = array_diff($variables['theme_hook_suggestions'], array('region__sidebar'));
|
109 |
//}
|
110 |
}
|
111 |
// */
|
112 |
|
113 |
/**
|
114 |
* Override or insert variables into the block templates.
|
115 |
*
|
116 |
* @param $variables
|
117 |
* An array of variables to pass to the theme template.
|
118 |
* @param $hook
|
119 |
* The name of the template being rendered ("block" in this case.)
|
120 |
*/
|
121 |
/* -- Delete this line if you want to use this function
|
122 |
function STARTERKIT_preprocess_block(&$variables, $hook) {
|
123 |
// Add a count to all the blocks in the region.
|
124 |
// $variables['classes_array'][] = 'count-' . $variables['block_id'];
|
125 |
|
126 |
// By default, Zen will use the block--no-wrapper.tpl.php for the main
|
127 |
// content. This optional bit of code undoes that:
|
128 |
//if ($variables['block_html_id'] == 'block-system-main') {
|
129 |
// $variables['theme_hook_suggestions'] = array_diff($variables['theme_hook_suggestions'], array('block__no_wrapper'));
|
130 |
//}
|
131 |
}
|
132 |
// */
|