metatag_google_plus.inc 764 B

1234567891011121314151617181920212223242526272829
  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. /**
  18. * {@inheritdoc}
  19. */
  20. public function getElement(array $options = array()) {
  21. $element = array();
  22. $value = $this->getValue($options);
  23. $element['#attached']['metatag_set_preprocess_variable'][] = array('html', 'itemtype', $value);
  24. return $element;
  25. }
  26. }