Skip to content

Commit

Permalink
fix article sitemap provider alternates
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jun 14, 2017
1 parent 11fb8f1 commit be571b9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sitemap/ArticleSitemapProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,16 @@ public function build($page, $portalKey)
if (!isset($alternatives[$item->getUuid()])) {
$alternatives[$item->getUuid()] = [];
} else {
// If exist add as alternative url
foreach ($alternatives as $alternative) {
// Add current as alternative to exist.
$alternative->addAlternateLink(
new SitemapAlternateLink($item->getRoutePath(), $item->getLocale())
);

// Add others as alternative to current.
$sitemapUrl->addAlternateLink(
new SitemapAlternateLink($alternative->getLoc(), $alternative->getLocale())
);
}
}

Expand Down

0 comments on commit be571b9

Please sign in to comment.