Posted by Randy74158 on December 16, 2012 at 3:23pm
6 followers
Jump to:
| Project: | Metatag |
| Version: | 7.x-1.x-dev |
| Component: | Dublin Core |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hello.
Now we have:
<meta name="description" content="My meta description copy." />
<meta property="og:description" content="My meta description copy." />However I know it works like that:<meta name="description" property="og:description" content="My meta description copy." />
Unfortunately, I have no idea how to combine these into one Meta string in this Metatag module.
Any help would be really appreciated.
Comments
#1
This would be a feature request, and an interesting one too!
#2
Ok, since I couldn't wait anymore longer, I 'fixed' it by my own solution:
<?php
function THEME_html_head_alter(&$head_elements)
{
$meta_desc = $head_elements['metatag_og:description']['#value'];
unset($head_elements['metatag_description']);
unset($head_elements['metatag_og:description']);
$head_elements[] = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'description',
'property' => 'og:description',
'content' => $meta_desc
)
);
}
?>
#3
Hi.
I also thought that this might be a good feature. However, I am not sure whether it is really needed. The reason is that websites (such as FaceBook) use this tag if they need og:description and cannot find it. Here is where I got the info from.
Amir
#4
I saw the stack overflow link too and came here to see if this had been discussed. I am wondering if there are any disadvantages of combining the two.
#5