summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnAlbin2011-11-25 10:01:08 (GMT)
committer JohnAlbin2011-11-25 10:01:14 (GMT)
commitff13562979e24d5cce0a61de3312ab21b0203eba (patch)
treeb948a5cd5e3e690c5988c4cc2f49430c2f69cf46
parentd8955e29ce6109130370fe70180c591bc03cfcb5 (diff)
parent923cd9d901a40d8ce60b37b3311b9c08a8289ef8 (diff)
Issue #1347236 by echoz and JohnAlbin: Convert page markup to HTML5
Merge branch '1347236-html5-page' into 7.x-5.x
-rw-r--r--CHANGELOG.txt1
-rw-r--r--STARTERKIT/css/pages.css2
-rw-r--r--STARTERKIT/sass/pages.scss2
-rw-r--r--templates/maintenance-page.tpl.php23
-rw-r--r--templates/page.tpl.php92
-rw-r--r--templates/region--footer.tpl.php33
-rw-r--r--templates/region--sidebar.tpl.php4
7 files changed, 104 insertions, 53 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 9e0952a..fceef40 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,5 +1,6 @@
Zen 7.x-5.x-dev, xxxx-xx-xx (development release)
---------------------------
+- #1347236: Convert page markup to HTML5
- #1352308: Add HTML comments for region template suggestions
- #1352296: Remove "with-navigation" class and make navigation bar display unconditionally
- #1348032: Convert breadcrumb markup to HTML5
diff --git a/STARTERKIT/css/pages.css b/STARTERKIT/css/pages.css
index 17f81a0..ae64805 100644
--- a/STARTERKIT/css/pages.css
+++ b/STARTERKIT/css/pages.css
@@ -80,6 +80,8 @@ body {
}
#site-slogan /* The slogan (or tagline) of a website */ {
+ margin: 0;
+ font-size: 1em;
}
.region-header /* Wrapper for any blocks placed in the header region */ {
diff --git a/STARTERKIT/sass/pages.scss b/STARTERKIT/sass/pages.scss
index 44b7df4..4eda03c 100644
--- a/STARTERKIT/sass/pages.scss
+++ b/STARTERKIT/sass/pages.scss
@@ -84,6 +84,8 @@ body {
}
#site-slogan { // The slogan (or tagline) of a website
+ margin: 0;
+ font-size: 1em;
}
.region-header { // Wrapper for any blocks placed in the header region
diff --git a/templates/maintenance-page.tpl.php b/templates/maintenance-page.tpl.php
index ef7a8a6..c67e070 100644
--- a/templates/maintenance-page.tpl.php
+++ b/templates/maintenance-page.tpl.php
@@ -39,30 +39,30 @@
<div id="page-wrapper"><div id="page">
- <div id="header"><div class="section clearfix">
+ <header id="header"><div class="section clearfix">
<?php if ($logo): ?>
<a href="<?php print $base_path; ?>" 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): ?>
- <div id="name-and-slogan">
+ <hgroup id="name-and-slogan">
<?php if ($site_name): ?>
- <div id="site-name"><strong>
+ <h1 id="site-name">
<a href="<?php print $base_path; ?>" title="<?php print t('Home'); ?>" rel="home">
<span><?php print $site_name; ?></span>
</a>
- </strong></div>
+ </h1>
<?php endif; ?>
<?php if ($site_slogan): ?>
- <div id="site-slogan"><?php print $site_slogan; ?></div>
+ <h2 id="site-slogan"><?php print $site_slogan; ?></h2>
<?php endif; ?>
- </div><!-- /#name-and-slogan -->
+ </hgroup><!-- /#name-and-slogan -->
<?php endif; ?>
<?php print $header; ?>
- </div></div><!-- /.section, /#header -->
+ </div></header><!-- /.section, /#header -->
<div id="main-wrapper"><div id="main" class="clearfix">
@@ -83,9 +83,12 @@
<?php print $navigation; ?>
</div><!-- /#navigation -->
- <?php print $sidebar_first; ?>
-
- <?php print $sidebar_second; ?>
+ <?php if ($sidebar_first || $sidebar_second): ?>
+ <aside class="sidebars">
+ <?php print $sidebar_first; ?>
+ <?php print $sidebar_second; ?>
+ </aside><!-- /.sidebars -->
+ <?php endif; ?>
</div></div><!-- /#main, /#main-wrapper -->
diff --git a/templates/page.tpl.php b/templates/page.tpl.php
index 9cc6a11..aff8794 100644
--- a/templates/page.tpl.php
+++ b/templates/page.tpl.php
@@ -72,48 +72,45 @@
<div id="page-wrapper"><div id="page">
- <div id="header"><div class="section clearfix">
+ <header id="header"><div class="section clearfix">
<?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): ?>
- <div id="name-and-slogan">
+ <hgroup id="name-and-slogan">
<?php if ($site_name): ?>
- <?php if ($title): ?>
- <div id="site-name"><strong>
- <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
- </strong></div>
- <?php else: /* Use h1 when the content title is empty */ ?>
- <h1 id="site-name">
- <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
- </h1>
- <?php endif; ?>
+ <h1 id="site-name">
+ <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
+ </h1>
<?php endif; ?>
<?php if ($site_slogan): ?>
- <div id="site-slogan"><?php print $site_slogan; ?></div>
+ <h2 id="site-slogan"><?php print $site_slogan; ?></h2>
<?php endif; ?>
- </div><!-- /#name-and-slogan -->
+ </hgroup><!-- /#name-and-slogan -->
<?php endif; ?>
- <?php print theme('links__system_secondary_menu', array(
- 'links' => $secondary_menu,
- 'attributes' => array(
- 'id' => 'secondary-menu',
- 'class' => array('links', 'inline', 'clearfix'),
- ),
- 'heading' => array(
- 'text' => $secondary_menu_heading,
- 'level' => 'h2',
- 'class' => array('element-invisible'),
- ),
- )); ?>
+ <?php if ($secondary_menu): ?>
+ <nav id="secondary-menu">
+ <?php print theme('links__system_secondary_menu', array(
+ 'links' => $secondary_menu,
+ 'attributes' => array(
+ 'class' => array('links', 'inline', 'clearfix'),
+ ),
+ 'heading' => array(
+ 'text' => $secondary_menu_heading,
+ 'level' => 'h2',
+ 'class' => array('element-invisible'),
+ ),
+ )); ?>
+ </nav>
+ <?php endif; ?>
<?php print render($page['header']); ?>
- </div></div><!-- /.section, /#header -->
+ </div></header><!-- /.section, /#header -->
<div id="main-wrapper"><div id="main" class="clearfix">
@@ -138,26 +135,39 @@
<div id="navigation"><div class="section clearfix">
- <?php print theme('links__system_main_menu', array(
- 'links' => $main_menu,
- 'attributes' => array(
- 'id' => 'main-menu',
- 'class' => array('links', 'inline', 'clearfix'),
- ),
- 'heading' => array(
- 'text' => t('Main menu'),
- 'level' => 'h2',
- 'class' => array('element-invisible'),
- ),
- )); ?>
+ <?php if ($main_menu): ?>
+ <nav id="main-menu">
+ <?php print theme('links__system_main_menu', array(
+ 'links' => $main_menu,
+ 'attributes' => array(
+ 'class' => array('links', 'inline', 'clearfix'),
+ ),
+ 'heading' => array(
+ 'text' => t('Main menu'),
+ 'level' => 'h2',
+ 'class' => array('element-invisible'),
+ ),
+ )); ?>
+ </nav>
+ <?php endif; ?>
+
<?php print render($page['navigation']); ?>
</div></div><!-- /.section, /#navigation -->
- <?php print render($page['sidebar_first']); ?>
-
- <?php print render($page['sidebar_second']); ?>
+ <?php
+ // Render the sidebars to see if there's anything in them.
+ $sidebar_first = render($page['sidebar_first']);
+ $sidebar_second = render($page['sidebar_second']);
+ ?>
+
+ <?php if ($sidebar_first || $sidebar_second): ?>
+ <aside class="sidebars">
+ <?php print $sidebar_first; ?>
+ <?php print $sidebar_second; ?>
+ </aside><!-- /.sidebars -->
+ <?php endif; ?>
</div></div><!-- /#main, /#main-wrapper -->
diff --git a/templates/region--footer.tpl.php b/templates/region--footer.tpl.php
new file mode 100644
index 0000000..a76a2cb
--- /dev/null
+++ b/templates/region--footer.tpl.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * @file
+ * Zen theme's implementation to display a region.
+ *
+ * Available variables:
+ * - $content: The content for this region, typically blocks.
+ * - $classes: String of classes that can be used to style contextually through
+ * CSS. It can be manipulated through the variable $classes_array from
+ * preprocess functions. The default values can be one or more of the following:
+ * - region: The current template type, i.e., "theming hook".
+ * - region-[name]: The name of the region with underscores replaced with
+ * dashes. For example, the page_top region would have a region-page-top class.
+ * - $region: The name of the region variable as defined in the theme's .info file.
+ *
+ * Helper variables:
+ * - $classes_array: Array of html class attribute values. It is flattened
+ * into a string within the variable $classes.
+ * - $is_admin: Flags true when the current user is an administrator.
+ * - $is_front: Flags true when presented in the front page.
+ * - $logged_in: Flags true when the current user is a logged-in member.
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_region()
+ * @see zen_preprocess_region()
+ * @see template_process()
+ */
+?>
+<?php if ($content): ?>
+ <footer id="footer" class="section <?php print $classes; ?>">
+ <?php print $content; ?>
+ </footer><!-- region--footer.tpl -->
+<?php endif; ?>
diff --git a/templates/region--sidebar.tpl.php b/templates/region--sidebar.tpl.php
index dd8d611..265b7be 100644
--- a/templates/region--sidebar.tpl.php
+++ b/templates/region--sidebar.tpl.php
@@ -27,7 +27,7 @@
*/
?>
<?php if ($content): ?>
- <div class="<?php print $classes; ?>"><div class="section">
+ <section class="<?php print $classes; ?>"><div class="section">
<?php print $content; ?>
- </div></div><!-- region--sidebar.tpl -->
+ </div></section><!-- region--sidebar.tpl -->
<?php endif; ?>