Change required for ZC155.
In ZC155 this section was added in /common/html_header.php.
<?php
// BOF hreflang for multilingual sites
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
$lng = new language;
}
reset($lng->catalog_languages);
while (list($key, $value) = each($lng->catalog_languages)) {
if ($value['id'] == $_SESSION['languages_id']) continue;
echo '<link rel="alternate" href="' . ($this_is_home_page ? zen_href_link(FILENAME_DEFAULT, 'language=' . $key, $request_type) : $canonicalLink .
'&language=' . $key) . '" hreflang="' . $key . '" />' . "\n";
}
// EOF hreflang for multilingual sites
?>
Ceon URI Mapping produces canonical links with no ?parameters:
<link rel="canonical" href="http://blah-blah.....aballetes/rg-padd-front-bk-caballete-delantero" />
so the additional &language needs to be ?language (or it becomes an invalid link that gives page not found).
I did this:
PHP Code:
<?php //steve bof CEON uri mapping
//CEON uri mapping produces a CANONICAL link with no ?parameters so '&language=' gets a page not found: need to change separator
$alternateSeparator = ( !isset($ceon_uri_mapping_canonical_uri) ? '&' : '?' );
?>
<?php
// BOF hreflang for multilingual sites
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
$lng = new language;
}
reset($lng->catalog_languages);
while (list($key, $value) = each($lng->catalog_languages)) {
if ($value['id'] == $_SESSION['languages_id']) continue;
echo '<link rel="alternate" href="' . ($this_is_home_page ? zen_href_link(FILENAME_DEFAULT, 'language=' . $key, $request_type) : $canonicalLink . $alternateSeparator . 'language=' . $key) . '" hreflang="' . $key . '" />' . "\n";//steve changed & for a variable separator
}
// EOF hreflang for multilingual sites
//steve eof CEON uri mapping
?>
Bookmarks