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