Going through some SEO lists and found that magento websites do not provide the proper meta language information in the head on all pages.
Very simple to correct on uni-lingual websites, modify the head.phtml file located in /app/design/frontend/default/YOUR_THEME/template/page/html/
In the meta section add the following (replace en-CA with the correct language of your store):
<meta name="language" content="en-CA" />
To address the issue on a multiluange site I've composed the following code:
<div class="meta-language">
<?php if($getStreId ==1) :?>
<meta name="language" content="en-CA" />
<?php endif; ?>
<meta name="language" content="fr-CA" />
</div>
The site id 1 is for Enlish, the other will be French (2 languages).
When I inspect the code with Firebug I see the following:
<meta name="language" content="en-CA" />
<meta name="language" content="fr-CA" />
The expected result was to only see the active language for the meta language tag.
How can the code be modified to only show the active language ?
Best Answer
The
if
statement should also have anelse
, so it would be something like thishowever there shouldn't be a
<div>
in the<head>
section of your HTML. So you might want to drop that.Also, there's not really a need to edit the
head.phtml
to add the<meta>
tag. You can add the following to yourlocal.xml
Just make sure you add the right storeview code to the
<STORE>
tag