diff --git a/metatag_apple/metatag_apple.info b/metatag_apple/metatag_apple.info new file mode 100644 index 0000000..0537e89 --- /dev/null +++ b/metatag_apple/metatag_apple.info @@ -0,0 +1,5 @@ +name = Metatag: Apple +description = "Provides support for Apple-specific meta tags, most notably Smart App Banners." +package = SEO +core = 7.x +dependencies[] = metatag diff --git a/metatag_apple/metatag_apple.metatag.inc b/metatag_apple/metatag_apple.metatag.inc new file mode 100644 index 0000000..b5c9372 --- /dev/null +++ b/metatag_apple/metatag_apple.metatag.inc @@ -0,0 +1,45 @@ +instance) { + case 'global': + $config->config += array( + 'apple-itunes-app' => array('value' => ''), + ); + break; + } + } +} + +/** + * Implements hook_metatag_info(). + */ +function metatag_apple_metatag_info() { + $info['groups']['apple'] = array( + 'label' => t('Apple'), + 'description' => t('A set of meta tags defined by Apple and used for connecting a site to their App Store.'), + 'form' => array( + '#weight' => 60, + ), + ); + + $info['tags']['apple-itunes-app'] = array( + 'label' => t('Smart App Banner parameters'), + 'description' => t('Parameters for configuring the Smart App Banner, as described at https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html.'), + 'class' => 'DrupalTextMetaTag', + 'group' => 'apple', + 'element' => array( + '#theme' => 'metatag_apple', + ), + ); + + return $info; +} diff --git a/metatag_apple/metatag_apple.module b/metatag_apple/metatag_apple.module new file mode 100644 index 0000000..b2d221b --- /dev/null +++ b/metatag_apple/metatag_apple.module @@ -0,0 +1,35 @@ + 1); + } +} + +/** + * Implements hook_theme(). + */ +function metatag_apple_theme() { + $info['metatag_apple'] = array( + 'render element' => 'element', + ); + + return $info; +} + +/** + * Theme callback for an Apple meta tag. + */ +function theme_metatag_apple($variables) { + $element = &$variables['element']; + element_set_attributes($element, array('#name' => 'name', '#value' => 'content')); + unset($element['#value']); + return theme('html_tag', $variables); +}