Posted by Juc1 on May 17, 2011 at 5:07pm
10 followers
| Project: | Meta tags quick |
| Version: | 7.x-2.x-dev |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | fixed |
Issue Summary
Hi all,
I am trying to add words for Meta Title, Meta keywords and Meta Description but I can only see fields for 'keywords' and 'Description'. Am I missing a Meta Title field?
Thanks
Comments
#1
Title is not a meta tag. If you want to manage it, please use http://drupal.org/project/page_title module
#2
OK, thank you.
#3
As a workaround, you can add a new field (field_meta_page_title)
And add this code to your template.php file:
<?php
function THEME_NAME_preprocess_html(&$head_elements) {
$elements = drupal_add_html_head();
if (!empty($elements['metatags_quick_meta_page_title']['#attributes']['content'])) {
$head_elements['head_title'] = $elements['metatags_quick_meta_page_title']['#attributes']['content'];
}
}
?>
#4
While the title isn't a meta tag, it's quite possible to create a meta title tag. There's generally much confusion of the two, som SEO people talking about 'meta title' when they in fact mean the title tag, and no-one seems to be able to prove any advantages to using meta title.
However, it can be put to good use nevertheless. Attached patch defines the title meta tag, and provides a new formatter for meta tags that sets the page title. Apart from allowing those wanting the title meta tag to use it, it can be used to make meta title act as an override for the title. This means moving in on page_title territory, but metatags_quick have the advantage of also working on non-node pages. It also makes sense as meta tags is the focus of SEO folks, and the other big SEO thing is ensuring the proper title, which isn't always best title for the node.
Also worth noting that it seems that the metatag module supports a 'meta title' element by setting the page title.
#5
I've tryed instruction in #3, but I notice that the drupal_add_html_head() returns me metatags_quick values only in not-node pages.
Is it normal?
#6
#3 worked fine for me on path-based pages
#7
The patch from comment #4 above works great, except that it also changes the h1 title printed on the page. I'm looking for a solution that allows me to have a completely different title in the
<title>tag and also allows me to override the default pattern (ie. including the "| sitename" part).The attached patch builds upon the one from comment #4. Basically when the display formatter is set to "default metatags_quick formatter" and the meta tag field is the title, it sets the "title" tag in addition to the meta tag of type "title". This allows me to have a different page title from the one in the h1 tag, and also allows me to remove the "| sitename" or change it in whatever way I wish.
#8
#7: thanks for a great amount of work. While the patch looks ok from the first sight, I would like to hear some responses if we need such a functionality inside metatags_quick (and not page_title, for example)
#9
@valthebald I guess one of the real benefits of this module over page_title is the ability to specify it for non-node pages, such as Views and Panels, that's why I did i this way.
#10
@stella: sounds like a valid use case, I never considered that
Committed to 2.x-dev, thank you!