page.tpl.php 6.2 KB
Newer Older
1
<?php
2

3
/**
4
5
 * @file
 * Default theme implementation to display a single Drupal page.
6
7
8
9
10
11
 *
 * Available variables:
 *
 * General utility variables:
 * - $base_path: The base URL path of the Drupal installation. At the very
 *   least, this will always default to /.
12
 * - $directory: The directory the template is located in, e.g. modules/system
13
 *   or themes/bartik.
14
 * - $is_front: TRUE if the current page is the front page.
15
16
17
18
 * - $logged_in: TRUE if the user is registered and signed in.
 * - $is_admin: TRUE if the user has permission to access administration pages.
 *
 * Site identity:
19
 * - $front_page: The URL of the front page. Use this instead of $base_path,
20
21
 *   when linking to the front page. This includes the language domain or
 *   prefix.
22
23
24
25
26
27
28
 * - $logo: The path to the logo image, as defined in theme configuration.
 * - $site_name: The name of the site, empty when display has been disabled
 *   in theme settings.
 * - $site_slogan: The slogan of the site, empty when display has been disabled
 *   in theme settings.
 *
 * Navigation:
29
 * - $main_menu (array): An array containing the Main menu links for the
30
 *   site, if they have been configured.
31
 * - $secondary_menu (array): An array containing the Secondary menu links for
32
 *   the site, if they have been configured.
33
 * - $breadcrumb: The breadcrumb trail for the current page.
34
 *
35
 * Page content (in order of occurrence in the default page.tpl.php):
36
37
38
 * - $title_prefix (array): An array containing additional output populated by
 *   modules, intended to be displayed in front of the main title tag that
 *   appears in the template.
39
 * - $title: The page title, for use in the actual HTML content.
40
41
42
 * - $title_suffix (array): An array containing additional output populated by
 *   modules, intended to be displayed after the main title tag that appears in
 *   the template.
43
44
 * - $messages: HTML for status and error messages. Should be displayed
 *   prominently.
45
46
47
48
 * - $tabs (array): Tabs linking to any sub-pages beneath the current page
 *   (e.g., the view and edit tabs when displaying a node).
 * - $action_links (array): Actions local to the page, such as 'Add menu' on the
 *   menu administration interface.
49
 * - $feed_icons: A string of all feed icons for the current page.
50
51
52
53
 * - $node: The node object, if there is an automatically-loaded node
 *   associated with the page, and the node ID is the second argument
 *   in the page's path (e.g. node/12345 and node/12345/revisions, but not
 *   comment/reply/12345).
54
 *
55
56
 * Regions:
 * - $page['help']: Dynamic help text, mostly for admin pages.
57
 * - $page['highlighted']: Items for the highlighted content region.
58
59
60
61
62
 * - $page['content']: The main content of the current page.
 * - $page['sidebar_first']: Items for the first sidebar.
 * - $page['sidebar_second']: Items for the second sidebar.
 * - $page['header']: Items for the header region.
 * - $page['footer']: Items for the footer region.
63
 *
64
 * @see template_preprocess()
65
 * @see template_preprocess_page()
66
 * @see template_process()
67
68
 */
?>
69

70
71
  <div id="page">
    <header id="header" role="banner">
72

73
74
75
76
77
78
79
      <?php if ($logo): ?>
        <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>
      <?php endif; ?>

      <?php if ($site_name || $site_slogan): ?>
80
        <div id="name-and-slogan">
81
82
          <?php if ($site_name): ?>
            <?php if ($title): ?>
83
84
85
              <p id="site-name"><strong>
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a>
              </strong></p>
86
87
            <?php else: /* Use h1 when the content title is empty */ ?>
              <h1 id="site-name">
88
                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><?php print $site_name; ?></a>
89
90
              </h1>
            <?php endif; ?>
91
92
          <?php endif; ?>

93
          <?php if ($site_slogan): ?>
94
            <p id="site-slogan"><?php print $site_slogan; ?></p>
95
          <?php endif; ?>
96
        </div><!-- #name-and-slogan -->
97
      <?php endif; ?>
98

99
      <?php print render($page['header']); ?>
100

101
    </header>
102

103
    <?php if ($main_menu || $secondary_menu): ?>
104
      <nav role="navigation">
105
106
        <?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'))); ?>
        <?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'))); ?>
107
      </nav>
108
109
    <?php endif; ?>

110
    <?php print $breadcrumb; ?>
111

112
113
114
    <?php if ($messages): ?>
      <div id="messages"><?php print $messages; ?></div>
    <?php endif; ?>
115

116
    <div id="main" role="main" class="clearfix">
117

118
      <div id="content" class="column">
119
        <?php if ($page['highlighted']): ?><div id="highlighted"><?php print render($page['highlighted']); ?></div><?php endif; ?>
120
        <a id="main-content"></a>
121
        <?php print render($title_prefix); ?>
122
        <?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
123
        <?php print render($title_suffix); ?>
Dries's avatar
Dries committed
124
        <?php if ($tabs): ?><div class="tabs"><?php print render($tabs); ?></div><?php endif; ?>
125
        <?php print render($page['help']); ?>
126
        <?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
127
        <?php print render($page['content']); ?>
128
        <?php print $feed_icons; ?>
129
      </div>
130

131
      <?php if ($page['sidebar_first']): ?>
132
        <div id="sidebar-first" class="column sidebar">
133
          <?php print render($page['sidebar_first']); ?>
134
        </div><!-- #sidebar-first -->
135
136
      <?php endif; ?>

137
      <?php if ($page['sidebar_second']): ?>
138
        <div id="sidebar-second" class="column sidebar">
139
          <?php print render($page['sidebar_second']); ?>
140
        </div><!-- #sidebar-second -->
141
142
      <?php endif; ?>

143
    </div><!-- #main -->
144

145
    <footer id="footer" role="contentinfo">
146
      <?php print render($page['footer']); ?>
147
    </footer>
148

149
  </div><!-- #page -->