Skip to content

Commit

Permalink
Only set alternateLinks if more than one locale is used. (#89)
Browse files Browse the repository at this point in the history
Only add alternateLinks if more than one locale is used.
  • Loading branch information
mjauvin authored Oct 7, 2024
1 parent 6d14cf7 commit 1e3f645
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions classes/MLPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ class MLPage
public static function resolveMenuItem(object $item, string $url, Theme $theme): ?array
{
$result = CmsPage::resolveMenuItem($item, $url, $theme);
$locales = Locale::listEnabled();

if ($result && ($page = CmsPage::loadCached($theme, $item->reference))) {

$locales = Locale::listEnabled();
if (count($locales) > 1 && $result && ($page = CmsPage::loadCached($theme, $item->reference))) {
$defaultLocale = Locale::getDefault();

$alternateLinks = [];
Expand Down

0 comments on commit 1e3f645

Please sign in to comment.