diff --git a/core/themes/seven/template.php b/core/themes/seven/template.php index 145ad22..5fb00ea 100644 --- a/core/themes/seven/template.php +++ b/core/themes/seven/template.php @@ -21,6 +21,58 @@ function seven_preprocess_html(&$vars) { } /** + * Implements hook_html_head_alter(). + */ +function seven_html_head_alter(&$head_elements) { + // W3C best practice. Supported by: iOS, Android, Palm Pre, Blackberry, Windows Phone. @see http://www.w3.org/TR/mwabp/#bp-viewport and http://developer.android.com/guide/webapps/targeting.html + $head_elements['viewport'] = array( + '#type' => 'html_tag', + '#tag' => 'meta', + '#attributes' => array( + 'name' => 'viewport', + 'content' => 'width=device-width, target-densitydpi=160dpi, initial-scale=1', + ), + ); + // Non-standard meta tags + // Older feature phones. Palm and Blackberries. @see http://docs.blackberry.com/en/developers/deliverables/26991/Supported_meta_tag_values_1457801_11.jsp + $head_elements['handheld_friendly'] = array( + '#type' => 'html_tag', + '#tag' => 'meta', + '#attributes' => array( + 'name' => 'HandheldFriendly', + 'content' => 'true', + ), + ); + // Older "Windows mobile" phones @see http://msdn.microsoft.com/en-us/library/bb431690.aspx + $head_elements['mobile_optimized'] = array( + '#type' => 'html_tag', + '#tag' => 'meta', + '#attributes' => array( + 'name' => 'MobileOptimized', + 'content' => 'width', + ), + ); + // iOS only, runs in full screen when added to the home screen. @see https://developer.apple.com/library/safari/#documentation/appleapplications/reference/SafariHTMLRef/Articles/MetaTags.html + $head_elements['apple_mobile_web_app_capable'] = array( + '#type' => 'html_tag', + '#tag' => 'meta', + '#attributes' => array( + 'name' => 'apple-mobile-web-app-capable', + 'content' => 'yes', + ), + ); + // Enables clear type for Windows Phone. @see http://msdn.microsoft.com/en-us/library/bb159711.aspx + $head_elements['ie_cleartype'] = array( + '#type' => 'html_tag', + '#tag' => 'meta', + '#attributes' => array( + 'http-equiv' => 'cleartype', + 'content' => 'on', + ), + ); +} + +/** * Override or insert variables into the page template. */ function seven_preprocess_page(&$vars) {