mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
Merge pull request #266 from micahsheets/2.2
Add default hreflang tag for pages without translations.
This commit is contained in:
commit
4ef5d462dd
@ -1584,6 +1584,22 @@ class Translatable extends DataExtension implements PermissionProvider {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// Added to comply with current Google recommendations
|
||||||
|
// If no translations found for this page, add a self referencing hreflang tag so Google does not complain
|
||||||
|
// Language and Local tag
|
||||||
|
$tags .= sprintf($template,
|
||||||
|
Convert::raw2xml($this->owner->Title),
|
||||||
|
i18n::convert_rfc1766($this->owner->Locale),
|
||||||
|
$this->owner->AbsoluteLink()
|
||||||
|
);
|
||||||
|
// Language only tag
|
||||||
|
$tags .= sprintf($template,
|
||||||
|
Convert::raw2xml($this->owner->Title),
|
||||||
|
i18n::get_lang_from_locale($this->owner->Locale),
|
||||||
|
$this->owner->AbsoluteLink()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function providePermissions() {
|
function providePermissions() {
|
||||||
|
Loading…
Reference in New Issue
Block a user