root / drupal7 / modules / system / page.tpl.php @ 76597ebf
1 |
<?php
|
---|---|
2 |
|
3 |
/**
|
4 |
* @file
|
5 |
* Default theme implementation to display a single Drupal page.
|
6 |
*
|
7 |
* The doctype, html, head and body tags are not in this template. Instead they
|
8 |
* can be found in the html.tpl.php template in this directory.
|
9 |
*
|
10 |
* Available variables:
|
11 |
*
|
12 |
* General utility variables:
|
13 |
* - $base_path: The base URL path of the Drupal installation. At the very
|
14 |
* least, this will always default to /.
|
15 |
* - $directory: The directory the template is located in, e.g. modules/system
|
16 |
* or themes/bartik.
|
17 |
* - $is_front: TRUE if the current page is the front page.
|
18 |
* - $logged_in: TRUE if the user is registered and signed in.
|
19 |
* - $is_admin: TRUE if the user has permission to access administration pages.
|
20 |
*
|
21 |
* Site identity:
|
22 |
* - $front_page: The URL of the front page. Use this instead of $base_path,
|
23 |
* when linking to the front page. This includes the language domain or
|
24 |
* prefix.
|
25 |
* - $logo: The path to the logo image, as defined in theme configuration.
|
26 |
* - $site_name: The name of the site, empty when display has been disabled
|
27 |
* in theme settings.
|
28 |
* - $site_slogan: The slogan of the site, empty when display has been disabled
|
29 |
* in theme settings.
|
30 |
*
|
31 |
* Navigation:
|
32 |
* - $main_menu (array): An array containing the Main menu links for the
|
33 |
* site, if they have been configured.
|
34 |
* - $secondary_menu (array): An array containing the Secondary menu links for
|
35 |
* the site, if they have been configured.
|
36 |
* - $breadcrumb: The breadcrumb trail for the current page.
|
37 |
*
|
38 |
* Page content (in order of occurrence in the default page.tpl.php):
|
39 |
* - $title_prefix (array): An array containing additional output populated by
|
40 |
* modules, intended to be displayed in front of the main title tag that
|
41 |
* appears in the template.
|
42 |
* - $title: The page title, for use in the actual HTML content.
|
43 |
* - $title_suffix (array): An array containing additional output populated by
|
44 |
* modules, intended to be displayed after the main title tag that appears in
|
45 |
* the template.
|
46 |
* - $messages: HTML for status and error messages. Should be displayed
|
47 |
* prominently.
|
48 |
* - $tabs (array): Tabs linking to any sub-pages beneath the current page
|
49 |
* (e.g., the view and edit tabs when displaying a node).
|
50 |
* - $action_links (array): Actions local to the page, such as 'Add menu' on the
|
51 |
* menu administration interface.
|
52 |
* - $feed_icons: A string of all feed icons for the current page.
|
53 |
* - $node: The node object, if there is an automatically-loaded node
|
54 |
* associated with the page, and the node ID is the second argument
|
55 |
* in the page's path (e.g. node/12345 and node/12345/revisions, but not
|
56 |
* comment/reply/12345).
|
57 |
*
|
58 |
* Regions:
|
59 |
* - $page['help']: Dynamic help text, mostly for admin pages.
|
60 |
* - $page['highlighted']: Items for the highlighted content region.
|
61 |
* - $page['content']: The main content of the current page.
|
62 |
* - $page['sidebar_first']: Items for the first sidebar.
|
63 |
* - $page['sidebar_second']: Items for the second sidebar.
|
64 |
* - $page['header']: Items for the header region.
|
65 |
* - $page['footer']: Items for the footer region.
|
66 |
*
|
67 |
* @see template_preprocess()
|
68 |
* @see template_preprocess_page()
|
69 |
* @see template_process()
|
70 |
* @see html.tpl.php
|
71 |
*
|
72 |
* @ingroup themeable
|
73 |
*/
|
74 |
?>
|
75 |
|
76 |
<div id="page-wrapper"><div id="page"> |
77 |
|
78 |
<div id="header"><div class="section clearfix"> |
79 |
|
80 |
<?php if ($logo): ?> |
81 |
<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo"> |
82 |
<img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" /> |
83 |
</a>
|
84 |
<?php endif; ?> |
85 |
|
86 |
<?php if ($site_name || $site_slogan): ?> |
87 |
<div id="name-and-slogan"> |
88 |
<?php if ($site_name): ?> |
89 |
<?php if ($title): ?> |
90 |
<div id="site-name"><strong> |
91 |
<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a> |
92 |
</strong></div> |
93 |
<?php else: /* Use h1 when the content title is empty */ ?> |
94 |
<h1 id="site-name"> |
95 |
<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a> |
96 |
</h1>
|
97 |
<?php endif; ?> |
98 |
<?php endif; ?> |
99 |
|
100 |
<?php if ($site_slogan): ?> |
101 |
<div id="site-slogan"><?php print $site_slogan; ?></div> |
102 |
<?php endif; ?> |
103 |
</div> <!-- /#name-and-slogan --> |
104 |
<?php endif; ?> |
105 |
|
106 |
<?php print render($page['header']); ?> |
107 |
|
108 |
</div></div> <!-- /.section, /#header --> |
109 |
|
110 |
<?php if ($main_menu || $secondary_menu): ?> |
111 |
<div id="navigation"><div class="section"> |
112 |
<?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t('Main menu'))); ?> |
113 |
<?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t('Secondary menu'))); ?> |
114 |
</div></div> <!-- /.section, /#navigation --> |
115 |
<?php endif; ?> |
116 |
|
117 |
<?php if ($breadcrumb): ?> |
118 |
<div id="breadcrumb"><?php print $breadcrumb; ?></div> |
119 |
<?php endif; ?> |
120 |
|
121 |
<?php print $messages; ?> |
122 |
|
123 |
<div id="main-wrapper"><div id="main" class="clearfix"> |
124 |
|
125 |
<div id="content" class="column"><div class="section"> |
126 |
<?php if ($page['highlighted']): ?><div id="highlighted"><?php print render($page['highlighted']); ?></div><?php endif; ?> |
127 |
<a id="main-content"></a> |
128 |
<?php print render($title_prefix); ?> |
129 |
<?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?> |
130 |
<?php print render($title_suffix); ?> |
131 |
<?php if ($tabs): ?><div class="tabs"><?php print render($tabs); ?></div><?php endif; ?> |
132 |
<?php print render($page['help']); ?> |
133 |
<?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?> |
134 |
<?php print render($page['content']); ?> |
135 |
<?php print $feed_icons; ?> |
136 |
</div></div> <!-- /.section, /#content --> |
137 |
|
138 |
<?php if ($page['sidebar_first']): ?> |
139 |
<div id="sidebar-first" class="column sidebar"><div class="section"> |
140 |
<?php print render($page['sidebar_first']); ?> |
141 |
</div></div> <!-- /.section, /#sidebar-first --> |
142 |
<?php endif; ?> |
143 |
|
144 |
<?php if ($page['sidebar_second']): ?> |
145 |
<div id="sidebar-second" class="column sidebar"><div class="section"> |
146 |
<?php print render($page['sidebar_second']); ?> |
147 |
</div></div> <!-- /.section, /#sidebar-second --> |
148 |
<?php endif; ?> |
149 |
|
150 |
</div></div> <!-- /#main, /#main-wrapper --> |
151 |
|
152 |
<div id="footer"><div class="section"> |
153 |
<?php print render($page['footer']); ?> |
154 |
</div></div> <!-- /.section, /#footer --> |
155 |
|
156 |
</div></div> <!-- /#page, /#page-wrapper --> |