diff --git a/core/includes/theme.inc b/core/includes/theme.inc index d044f06..5ea77ea 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2533,6 +2533,9 @@ function template_preprocess_html(&$variables) { $variables['head_title_array'] = $head_title; $variables['head_title'] = implode(' | ', $head_title); + // Mobile Metatags, used for Responsive Webdesign. Metatags are added in html.tpl.php + $variables['default_mobile_metatags'] = TRUE; + // Populate the page template suggestions. if ($suggestions = theme_get_suggestions(arg(), 'html')) { $variables['theme_hook_suggestions'] = $suggestions; diff --git a/core/modules/system/html.tpl.php b/core/modules/system/html.tpl.php index 960eefb..d587dcc 100644 --- a/core/modules/system/html.tpl.php +++ b/core/modules/system/html.tpl.php @@ -22,6 +22,8 @@ * - slogan: The slogan of the site, if any, and if there is no title. * - $head: Markup for the HEAD section (including meta tags, keyword tags, and * so on). + * - $default_mobile_metatags: (boolean) If TRUE, default mobile metatags for + * Responsive Design will be included. * - $styles: Style tags necessary to import all CSS files for the page. * - $scripts: Script tags necessary to load the JavaScript files and settings * for the page. @@ -43,6 +45,13 @@ > + + + + + + + <?php print $head_title; ?> diff --git a/core/modules/system/system.test b/core/modules/system/system.test index 9287d16..2879380 100644 --- a/core/modules/system/system.test +++ b/core/modules/system/system.test @@ -880,6 +880,36 @@ class AdminMetaTagTestCase extends DrupalWebTestCase { } } +class MobileMetaTagTestCase extends DrupalWebTestCase { + /** + * Implement getInfo(). + */ + public static function getInfo() { + return array( + 'name' => 'Mobile meta tags', + 'description' => 'Confirm that the mobile meta tags appear as expected.', + 'group' => 'System' + ); + } + + /** + * Verify that the meta tag HTML is generated correctly. + */ + public function testMetaTag() { + $metatags = array( + 'MobileOptimized' => '', + 'apple-mobile-web-app-capable' => '', + 'HandheldFriendly' => '', + 'viewport' => '', + 'cleartype' => '' + ); + $this->drupalGet(''); + foreach ($metatags as $name => $metatag) { + $this->assertRaw($metatag, t('Mobile meta tag "'.$name.'" generated correctly.'), t('System')); + } + } +} + /** * Tests custom access denied functionality. */