diff --git a/metatag.inc b/metatag.inc index 478f8d6..1131783 100644 --- a/metatag.inc +++ b/metatag.inc @@ -130,16 +130,23 @@ class BackdropDefaultMetaTag implements BackdropMetaTagInterface { } // Combine the base configuration for this meta tag with the value. - $attribute = 'name'; $element = $base_element + array( '#tag' => 'meta', '#attributes' => array( - $attribute => $this->info['name'], 'content' => $value, ), '#weight' => $this->getWeight(), ); + if (in_array($this->info['group'], array('facebook', 'open-graph'))) { + // Open Graph tags need a property attribute, instead of name. + $element['#attributes']['property'] = $this->info['name']; + } + else { + // Fall back to name attribute for all others. + $element['#attributes']['name'] = $this->info['name']; + } + // Add header information if desired. if (!empty($this->info['header'])) { $element['#attached']['backdrop_add_http_header'][] = array($this->info['header'], $value);