Issue #624058: Replace _zen_path() with drupal_get_path('theme', 'zen')
[project/zen.git] / templates / page.tpl.php
1 <?php
2 /**
3 * @file
4 * Theme implementation to display a single Drupal page.
5 *
6 * Available variables:
7 *
8 * General utility variables:
9 * - $base_path: The base URL path of the Drupal installation. At the very
10 * least, this will always default to /.
11 * - $css: An array of CSS files for the current page.
12 * - $directory: The directory the template is located in, e.g. modules/system
13 * or themes/garland.
14 * - $is_front: TRUE if the current page is the front page. Used to toggle the mission statement.
15 * - $logged_in: TRUE if the user is registered and signed in.
16 * - $is_admin: TRUE if the user has permission to access administration pages.
17 *
18 * Page metadata:
19 * - $language: (object) The language the site is being displayed in.
20 * $language->language contains its textual representation.
21 * $language->dir contains the language direction. It will either be 'ltr' or 'rtl'.
22 * - $head_title: A modified version of the page title, for use in the TITLE tag.
23 * - $head: Markup for the HEAD section (including meta tags, keyword tags, and
24 * so on).
25 * - $styles: Style tags necessary to import all CSS files for the page.
26 * - $scripts: Script tags necessary to load the JavaScript files and settings
27 * for the page.
28 * - $classes: String of classes that can be used to style contextually through
29 * CSS. It should be placed within the <body> tag. When selecting through CSS
30 * it's recommended that you use the body tag, e.g., "body.front". It can be
31 * manipulated through the variable $classes_array from preprocess functions.
32 * The default values can be one or more of the following:
33 * - front: Page is the home page.
34 * - not-front: Page is not the home page.
35 * - logged-in: The current viewer is logged in.
36 * - not-logged-in: The current viewer is not logged in.
37 * - node-type-[node type]: When viewing a single node, the type of that node.
38 * For example, if the node is a "Blog entry" it would result in "node-type-blog".
39 * Note that the machine name will often be in a short form of the human readable label.
40 * - page-views: Page content is generated from Views. Note: a Views block
41 * will not cause this class to appear.
42 * - page-panels: Page content is generated from Panels. Note: a Panels block
43 * will not cause this class to appear.
44 * The following only apply with the default 'sidebar_first' and 'sidebar_second' block regions:
45 * - two-sidebars: When both sidebars have content.
46 * - no-sidebars: When no sidebar content exists.
47 * - one-sidebar and sidebar-first or sidebar-second: A combination of the
48 * two classes when only one of the two sidebars have content.
49 * - $node: Full node object. Contains data that may not be safe. This is only
50 * available if the current page is on the node's primary url.
51 * - $menu_item: (array) A page's menu item. This is only available if the
52 * current page is in the menu.
53 *
54 * Site identity:
55 * - $front_page: The URL of the front page. Use this instead of $base_path,
56 * when linking to the front page. This includes the language domain or prefix.
57 * - $logo: The path to the logo image, as defined in theme configuration.
58 * - $site_name: The name of the site, empty when display has been disabled
59 * in theme settings.
60 * - $site_slogan: The slogan of the site, empty when display has been disabled
61 * in theme settings.
62 * - $mission: The text of the site mission, empty when display has been disabled
63 * in theme settings.
64 *
65 * Navigation:
66 * - $search_box: HTML to display the search box, empty if search has been disabled.
67 * - $primary_links (array): An array containing the Primary menu links for the
68 * site, if they have been configured.
69 * - $secondary_links (array): An array containing the Secondary menu links for
70 * the site, if they have been configured.
71 * - $breadcrumb: The breadcrumb trail for the current page.
72 *
73 * Page content (in order of occurrence in the default page.tpl.php):
74 * - $title: The page title, for use in the actual HTML content.
75 * - $messages: HTML for status and error messages. Should be displayed prominently.
76 * - $tabs: Tabs linking to any sub-pages beneath the current page (e.g., the
77 * view and edit tabs when displaying a node).
78 * - $help: Dynamic help text, mostly for admin pages.
79 * - $content: The main content of the current page.
80 * - $feed_icons: A string of all feed icons for the current page.
81 *
82 * Footer/closing data:
83 * - $footer_message: The footer message as defined in the admin settings.
84 * - $closure: Final closing markup from any modules that have altered the page.
85 * This variable should always be output last, after all other dynamic content.
86 *
87 * Helper variables:
88 * - $classes_array: Array of html class attribute values. It is flattened
89 * into a string within the variable $classes.
90 *
91 * Regions:
92 * - $content_top: Items to appear above the main content of the current page.
93 * - $content_bottom: Items to appear below the main content of the current page.
94 * - $navigation: Items for the navigation bar.
95 * - $sidebar_first: Items for the first sidebar.
96 * - $sidebar_second: Items for the second sidebar.
97 * - $header: Items for the header region.
98 * - $footer: Items for the footer region.
99 * - $page_closure: Items to appear below the footer.
100 *
101 * The following variables are deprecated and will be removed in Drupal 7:
102 * - $body_classes: This variable has been renamed $classes in Drupal 7.
103 *
104 * @see template_preprocess()
105 * @see template_preprocess_page()
106 * @see zen_preprocess()
107 * @see zen_process()
108 */
109 ?>
110 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
111 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>">
112
113 <head>
114 <title><?php print $head_title; ?></title>
115 <?php print $head; ?>
116 <?php print $styles; ?>
117 <?php print $scripts; ?>
118 </head>
119 <body class="<?php print $classes; ?>">
120
121 <?php if ($primary_links): ?>
122 <div id="skip-link"><a href="#main-menu"><?php print t('Jump to Navigation'); ?></a></div>
123 <?php endif; ?>
124
125 <div id="page-wrapper"><div id="page">
126
127 <div id="header"><div class="section clearfix">
128
129 <?php if ($logo): ?>
130 <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>
131 <?php endif; ?>
132
133 <?php if ($site_name || $site_slogan): ?>
134 <div id="name-and-slogan">
135 <?php if ($site_name): ?>
136 <?php if ($title): ?>
137 <div id="site-name"><strong>
138 <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
139 </strong></div>
140 <?php else: /* Use h1 when the content title is empty */ ?>
141 <h1 id="site-name">
142 <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
143 </h1>
144 <?php endif; ?>
145 <?php endif; ?>
146
147 <?php if ($site_slogan): ?>
148 <div id="site-slogan"><?php print $site_slogan; ?></div>
149 <?php endif; ?>
150 </div><!-- /#name-and-slogan -->
151 <?php endif; ?>
152
153 <?php if ($search_box): ?>
154 <div id="search-box"><?php print $search_box; ?></div>
155 <?php endif; ?>
156
157 <?php print $header; ?>
158
159 </div></div><!-- /.section, /#header -->
160
161 <div id="main-wrapper"><div id="main" class="clearfix<?php if ($primary_links || $navigation) { print ' with-navigation'; } ?>">
162
163 <div id="content" class="column"><div class="section">
164
165 <?php if ($mission): ?>
166 <div id="mission"><?php print $mission; ?></div>
167 <?php endif; ?>
168
169 <?php print $highlight; ?>
170
171 <?php print $breadcrumb; ?>
172 <?php if ($title): ?>
173 <h1 class="title"><?php print $title; ?></h1>
174 <?php endif; ?>
175 <?php print $messages; ?>
176 <?php if ($tabs): ?>
177 <div class="tabs"><?php print $tabs; ?></div>
178 <?php endif; ?>
179 <?php print $help; ?>
180
181 <?php print $content_top; ?>
182
183 <div id="content-area">
184 <?php print $content; ?>
185 </div>
186
187 <?php print $content_bottom; ?>
188
189 <?php if ($feed_icons): ?>
190 <div class="feed-icons"><?php print $feed_icons; ?></div>
191 <?php endif; ?>
192
193 </div></div><!-- /.section, /#content -->
194
195 <?php if ($primary_links || $navigation): ?>
196 <div id="navigation"><div class="section clearfix">
197
198 <?php print theme(array('links__system_main_menu', 'links'), $primary_links,
199 array(
200 'id' => 'main-menu',
201 'class' => 'links clearfix',
202 ),
203 array(
204 'text' => t('Main menu'),
205 'level' => 'h2',
206 'class' => 'element-invisible',
207 ));
208 ?>
209
210 <?php print $navigation; ?>
211
212 </div></div><!-- /.section, /#navigation -->
213 <?php endif; ?>
214
215 <?php print $sidebar_first; ?>
216
217 <?php print $sidebar_second; ?>
218
219 </div></div><!-- /#main, /#main-wrapper -->
220
221 <?php if ($footer || $footer_message || $secondary_links): ?>
222 <div id="footer"><div class="section">
223
224 <?php print theme(array('links__system_secondary_menu', 'links'), $secondary_links,
225 array(
226 'id' => 'secondary-menu',
227 'class' => 'links clearfix',
228 ),
229 array(
230 'text' => t('Secondary menu'),
231 'level' => 'h2',
232 'class' => 'element-invisible',
233 ));
234 ?>
235
236 <?php if ($footer_message): ?>
237 <div id="footer-message"><?php print $footer_message; ?></div>
238 <?php endif; ?>
239
240 <?php print $footer; ?>
241
242 </div></div><!-- /.section, /#footer -->
243 <?php endif; ?>
244
245 </div></div><!-- /#page, /#page-wrapper -->
246
247 <?php print $page_closure; ?>
248
249 <?php print $closure; ?>
250
251 </body>
252 </html>