4 * Theme implementation to display a single Drupal page.
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
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.
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
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
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.
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
60 * - $site_slogan: The slogan of the site, empty when display has been disabled
62 * - $mission: The text of the site mission, empty when display has been disabled
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.
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.
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.
88 * - $classes_array: Array of html class attribute values. It is flattened
89 * into a string within the variable $classes.
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.
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.
104 * @see template_preprocess()
105 * @see template_preprocess_page()
106 * @see zen_preprocess()
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; ?>">
114 <title
><?php
print $head_title; ?
></title
>
115 <?php
print $head; ?
>
116 <?php
print $styles; ?
>
117 <?php
print $scripts; ?
>
119 <body
class="<?php print $classes; ?>">
121 <?php
if ($primary_links): ?
>
122 <div id
="skip-link"><a href
="#main-menu"><?php
print t('Jump to Navigation'); ?
></a
></div
>
125 <div id
="page-wrapper"><div id
="page">
127 <div id
="header"><div
class="section clearfix">
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
>
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
>
140 <?php
else: /* Use h1 when the content title is empty */ ?
>
142 <a href
="<?php print $front_page; ?>" title
="<?php print t('Home'); ?>" rel
="home"><span
><?php
print $site_name; ?
></span
></a
>
147 <?php
if ($site_slogan): ?
>
148 <div id
="site-slogan"><?php
print $site_slogan; ?
></div
>
150 </div
><!-- /#name-and-slogan -->
153 <?php
if ($search_box): ?
>
154 <div id
="search-box"><?php
print $search_box; ?
></div
>
157 <?php
print $header; ?
>
159 </div
></div
><!-- /.section
, /#header -->
161 <div id
="main-wrapper"><div id
="main" class="clearfix<?php if ($primary_links || $navigation) { print ' with-navigation'; } ?>">
163 <div id
="content" class="column"><div
class="section">
165 <?php
if ($mission): ?
>
166 <div id
="mission"><?php
print $mission; ?
></div
>
169 <?php
print $highlight; ?
>
171 <?php
print $breadcrumb; ?
>
172 <?php
if ($title): ?
>
173 <h1
class="title"><?php
print $title; ?
></h1
>
175 <?php
print $messages; ?
>
177 <div
class="tabs"><?php
print $tabs; ?
></div
>
179 <?php
print $help; ?
>
181 <?php
print $content_top; ?
>
183 <div id
="content-area">
184 <?php
print $content; ?
>
187 <?php
print $content_bottom; ?
>
189 <?php
if ($feed_icons): ?
>
190 <div
class="feed-icons"><?php
print $feed_icons; ?
></div
>
193 </div
></div
><!-- /.section
, /#content -->
195 <?php
if ($primary_links || $navigation): ?
>
196 <div id
="navigation"><div
class="section clearfix">
198 <?php
print theme(array('links__system_main_menu', 'links'), $primary_links,
201 'class' => 'links clearfix',
204 'text' => t('Main menu'),
206 'class' => 'element-invisible',
210 <?php
print $navigation; ?
>
212 </div
></div
><!-- /.section
, /#navigation -->
215 <?php
print $sidebar_first; ?
>
217 <?php
print $sidebar_second; ?
>
219 </div
></div
><!-- /#main, /#main-wrapper -->
221 <?php
if ($footer || $footer_message || $secondary_links): ?
>
222 <div id
="footer"><div
class="section">
224 <?php
print theme(array('links__system_secondary_menu', 'links'), $secondary_links,
226 'id' => 'secondary-menu',
227 'class' => 'links clearfix',
230 'text' => t('Secondary menu'),
232 'class' => 'element-invisible',
236 <?php
if ($footer_message): ?
>
237 <div id
="footer-message"><?php
print $footer_message; ?
></div
>
240 <?php
print $footer; ?
>
242 </div
></div
><!-- /.section
, /#footer -->
245 </div
></div
><!-- /#page, /#page-wrapper -->
247 <?php
print $page_closure; ?
>
249 <?php
print $closure; ?
>