Closed (fixed)
Project:
Metatag
Version:
7.x-1.x-dev
Component:
Other tags
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Nov 2011 at 11:23 UTC
Updated:
15 Jun 2015 at 12:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
akcakaya commentedHello,
I need language meta tag for SEO in my website. How can i add Language meta tag?
Regards,
Comment #2
marcoka commented+1, even if i have the opinion that google ignores this and analyzes the text (text analyze shows it the language). other opinions?
Comment #3
colanFeature requests go into HEAD.
Comment #4
damienmckennaComment #5
Sinan Erdem commentedAny progress on this?
Comment #6
rar9 commentedis this now in beta 5?
Comment #7
damienmckennaComment #8
giannisr commentedAny progress or solution on this?
Comment #9
aschiwi commentedFrom this issue I assume this is not being worked on. So as usual, patches are welcome.
Comment #10
Michsk commentedCreate a custom module (i called mine metatag_hacks) and add the following snippet in your module.module. It implements
hook_metatag_info().Comment #11
damienmckenna@lasac: Or you could make a patch..
Comment #12
Michsk commentedWill do. Just saw that the snippet is not correct we need
http-equiv=''and notname=''.Comment #13
Michsk commentedHere is the patch.
Comment #14
Michsk commentedlooks like the tabs are not converted to spaces. In drupal we use 2 or 4 spaces for a tab?
Comment #15
Michsk commentedIndents should be fixed.
Comment #16
Michsk commentedguess not
Comment #17
Michsk commentedAnd now...
Comment #18
Michsk commentedLast time.
Comment #19
Michsk commentedas a sidenote i would advice the following patch for this as well:
https://drupal.org/node/975116
This gives you language tokens.
Comment #20
damienmckennaThanks for putting the effort into this patch, I'll review it later today.
BTW when you upload a patch you need to change the status to "Needs review" as that both triggers the automated test system and informs others that it's ready to be manually tested & reviewed too.
Comment #21
Michsk commentedGot it. Here is the final patch, others should be forgotton.
Comment #23
damienmckennaThere's one small thing that needs to be fixed - you have some hard tabs at the closing line of the $element definition.
Comment #24
Michsk commentedNew patch.
Comment #25
Michsk commentedI must say tough that my hands are itching when i see
metatag.inc. We really should have the new objects just define a different template in stead of copy-pasting the wholegetElement()method.If i can find the time i would like to have a look at refactoring the code a bit if you like.
Comment #26
damienmckennaComment #27
damienmckenna@Lasac: I'm always interested in seeing how others can help improve the module :)
Comment #28
Michsk commentedGlad this hasn't been committed yet. After taking a better look at the code the following patch will do all we need without creating a whole new object.
Comment #29
Michsk commentedWoops
Comment #29.0
Michsk commentedexample wasn't visible, so surrounded it by the code-tags.
Comment #30
jordanmagnuson commentedFYI, missing meta language information is reported as a "Moderate" SEO compliance issue by Bing webmaster tools.
Comment #31
rondev commentedI tested it with #975116: Create a 'language' token type (D7) to get a token.
Seems OK.
I use [language:language-content] for content language in the Global section of Metatag.
Comment #32
damienmckennaThis needs a description added to explain what the meta tag is for and what acceptable values are.
Comment #33
aprohl5 commentedI went to add the description field for the "language-content" meta tag and, after reading the w3 documentation on the tag ( http://www.w3.org/International/questions/qa-http-and-lang ) learned that this tag is deprecated and should not be used. As an alternative, you should include the "lang" attribute in the tag, drupal 7 does this already on both translated and non translated sites. If you would like I can still make the fix to the description field on the patch.
Comment #34
aprohl5 commentedComment #35
aprohl5 commentedComment #36
damienmckennaCommitted. Thanks everyone!
Comment #38
damienmckennaComment #40
selinav commentedExcuse-me I have update with the RC2 version and I don't see the meta content language in my content pages.
Where should I set this ?
Comment #41
selinav commentedHello after update to the 7x-1.5, the meta content language still doesn't display,
I've entered on the admin/config/search/metatags (Global) page the field
Content language= [metatag:content-language]But on the source code, it doesn't appears.
What is the mistake ?
Best regards
Comment #42
damienmckennaAny time you use a "metatag" token in a metatag that means that you want it to use another meta tag value in place of the current one, e.g. using [metatag:description] in og:description. You should be using [node:language] to display a node's language, or apply the patch from #975116: Create a 'language' token type (D7) to add a new token to show the current page's language.
Also, the fact that you're using [metatag:content-language] in the "content language" tag means that you're created a circular reference; this would have crashed older versions but 1.5 is able to identify these (to a degree) and now blow up your site :)
Comment #43
selinav commentedDamienMcKenna, thanks for the reply. I did not understand it is a circular reference.
If I use [node:language] it well works for node.
What is the token to use for the homepage ([current-page:query:?], views or taxonomy ?
Thanks in advance
Comment #44
damienmckenna@selinav: You need to use the patch from #975116: Create a 'language' token type (D7), then you'll have a new token for the current language that could be used in the global settings.