README.txt 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Metatag: Google+
  2. -----------------
  3. This module adds support for meta tag configuration for Google+ Snippet [1].
  4. The following Google+ tags are provided:
  5. * itemprop:name
  6. * itemprop:description
  7. * itemprop:image
  8. Also itemtype is provided to add schema in the HTML markup as follows:
  9. <html itemscope itemtype="http://schema.org/Article">
  10. Usage
  11. --------------------------------------------------------------------------------
  12. Page type (itemtype) provides default type options from the Google+ Snippet page
  13. [1]; to add other types either install select_or_other module [2] or use the
  14. Metatag hooks (see metatag.api.php).
  15. Known Issues
  16. --------------------------------------------------------------------------------
  17. - When using Zen or its derived theme, the RDF Namespaces will be serialized
  18. into an RDFa 1.1 prefix attribute, which means itemtype will be included in
  19. prefix="...". To avoid this problem, this module will not add a itemtype
  20. directly to $variable['rdf_namespaces'], instead, it will be necessary to add
  21. code manually in the template.php or the custom theme.
  22. Example code to use and adapt as needed:
  23. /**
  24. * Implements template_preprocess_html().
  25. *
  26. * Add itemtype code for Google+ in the 'html_attributes_array' which is only
  27. * available in Zen theme. Note Zen will convert rdf_namespaces to RDFa 1.1 with
  28. * prefix, so putting itemtype there will cause it to be added to the
  29. * prefix="itemtype=..." attribute.
  30. *
  31. * @see zen_preprocess_html()
  32. */
  33. function MYTHEME_preprocess_html(&$variables, $hook) {
  34. if (module_exists('metatag_google_plus') && isset($variables['itemtype'])) {
  35. $variables['html_attributes_array']['itemscope itemtype'] = "http://schema.org/{$variables['itemtype']}";
  36. }
  37. }
  38. Credits / Contact
  39. --------------------------------------------------------------------------------
  40. Originally developed by Eric Chen [3] and sponsored by Monkii [4].
  41. References
  42. --------------------------------------------------------------------------------
  43. 1: https://developers.google.com/+/web/snippet/
  44. 2. https://drupal.org/project/select_or_other
  45. 3: https://drupal.org/user/265729
  46. 4: http://monkii.com