mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
Update Translatable::MetaTags() to fix hreflang tags issue when page link has get params
This commit is contained in:
parent
bb4d553b9c
commit
b76859b194
@ -1572,6 +1572,13 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
* @return string HTML
|
||||
*/
|
||||
function MetaTags(&$tags) {
|
||||
if (
|
||||
($controller = Controller::curr())
|
||||
&& count($controller->getRequest()->getVars())
|
||||
) {
|
||||
$tags .= '<link rel="canonical" href="'.$controller->AbsoluteLink().'" />';
|
||||
return;
|
||||
}
|
||||
$template = '<link rel="alternate" type="text/html" title="%s" hreflang="%s" href="%s" />' . "\n";
|
||||
$translations = $this->owner->getTranslations();
|
||||
if($translations->count()) {
|
||||
|
Loading…
Reference in New Issue
Block a user