Skip to content

Commit 678727e

Browse files
Stephen Mulvihillsylus
authored andcommitted
Issue #3321303 by smulvih2: Horizontal main menu more links
1 parent 8ea1c93 commit 678727e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Plugin/Preprocess/Menu.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ public function preprocess(array &$variables, $hook, array $info) {
4141
if (!$this->theme->getSetting('wxt_megamenu_more_link')) {
4242
foreach ($variables['items'] as $key => &$item) {
4343
if (isset($item['below']) && $item['below']) {
44-
$mb_more = $item;
45-
$mb_more['title'] = $mb_more['title'] . ' ' . $this->t('– More');
46-
$mb_more['attributes']->addClass('slflnk');
47-
unset($mb_more['below']);
48-
$item['below'][$key] = $mb_more;
44+
if (!empty($item['url']->toString())) {
45+
$mb_more = $item;
46+
$mb_more['title'] = $mb_more['title'] . ' ' . $this->t('– More');
47+
$mb_more['attributes']->addClass('slflnk');
48+
unset($mb_more['below']);
49+
$item['below'][$key] = $mb_more;
50+
}
4951
}
5052
}
5153
}

0 commit comments

Comments
 (0)