metatag_google_plus.inc 732 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * @file
  4. * Metatag controller for Google+.
  5. */
  6. /**
  7. * Schema meta tag controller.
  8. *
  9. * This extends DrupalTextMetaTag as we need to alter variables in
  10. * template_preprocess_html() rather output a normal meta tag.
  11. *
  12. * This controller is little different from DrupalTitleMetaTag and same value in
  13. * the itemtype instead of title. So in the MYTHEME_preprocess_html(),
  14. * $variable['itemtype'] will be provided.
  15. */
  16. class DrupalSchemaMetaTag extends DrupalTextMetaTag {
  17. public function getElement(array $options = array()) {
  18. $element = array();
  19. $value = $this->getValue($options);
  20. $element['#attached']['metatag_set_preprocess_variable'][] = array('html', 'itemtype', $value);
  21. return $element;
  22. }
  23. }