Skip to content

Instantly share code, notes, and snippets.

@speedygfw
Created June 25, 2015 07:42
Show Gist options
  • Save speedygfw/3917d4b5fbab2fbaebe4 to your computer and use it in GitHub Desktop.
Save speedygfw/3917d4b5fbab2fbaebe4 to your computer and use it in GitHub Desktop.
OXID - Kanonische URLs in Kategorien auf die Hauptseite zeigen lassen
public function getCanonicalUrl()
{
if (($oCategory = $this->getActiveCategory())) {
$oUtils = oxRegistry::get("oxUtilsUrl");
if (oxRegistry::getUtils()->seoIsActive()) {
$sUrl = $oUtils->prepareCanonicalUrl(
$oCategory->getBaseSeoLink($oCategory->getLanguage(), '')
);
} else {
$sUrl = $oUtils->prepareCanonicalUrl(
$oCategory->getBaseStdLink($oCategory->getLanguage(), '')
);
}
return $sUrl;
}
}
@speedygfw
Copy link
Author

Dazu die alist erweitern!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment