21285 Posts in 5732 Topics by 2602 members
General Questions
SilverStripe Forums » General Questions » Use this page as the 'home page' for the following domains
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | ||
| Author | Topic: | 1554 Views |
-
Re: Use this page as the 'home page' for the following domains

23 February 2012 at 5:00pm
Hey Jason,
thanks for the feedback and the patch. i just took a look and this is actually a bug with the Translatable class in SS 2.3+. it uses similar code to put in the faulty links in the page:function MetaTags(&$tags) {
$template = '<link rel="alternate" type="text/html" title="%s" hreflang="%s" href="%s" />' . "\n";
$translations = $this->owner->getTranslations();
if($translations) foreach($translations as $translation) {
$tags .= sprintf($template,
$translation->Title,
i18n::convert_rfc1766($translation->Locale),
$translation->Link()
);
}
}if it was changed to write in $translation->AbsoluteLink() it would be correct, but Link() essentially gives a relative link. i just made a patch and sent a pull request for the Translatable module for Silverstripe 3.0, so we wouldnt need this patch in the future. For 2.4, we could either add this to SingleLocaleDomain so it removes code then adds code, or we could write another class that extends translatable and use it in place of translatable, then override the Metatags function in the Translatable extension. either way i'll probably have to branch the development in github. (now that i think about it, i think they are changing decorators in SS3.0 too so i'd probably have to do that sometime anyways).
any thoughts here? i'm tempted to override Translatable instead to fix the root cause of the problem.
thanks again for the patch and letting me know about the issue.
-Chris
| 1554 Views | ||
| Go to Top |
