Problem/Motivation

When your menu contains internal and external links, you can sometimes break the active-trail chain.

For example:

When you are on the contact page, the Link 1.1 has the is-active class, it's parent <li> has the active-trail class but the link 1's <li> does not.

Proposed resolution

Get the active-trail add out of the !external condition.

Comments

DuaelFr created an issue. See original summary.

duaelfr’s picture

Assigned: duaelfr » Unassigned
Status: Active » Needs review
StatusFileSize
new1.11 KB

This patch also includes a minor performances improvement (conditions are calculated from left to right so let's get the easiest checks on the left).

duaelfr’s picture

Given the patch in #2825106-15: HTTP 500 Internal Server Error after update to 8.x-1.0-rc3 it looks better to use $menu_item->link->getUrlObject()->isRouted() instead of relying on $item['options']['external'].

duaelfr’s picture

StatusFileSize
new1.59 KB

Patch rerolled against latest dev.

  • mehrpadin committed 5ef4d24 on 8.x-1.x authored by DuaelFr
    Issue #2828015 by DuaelFr: The .active-trail css class is never applied...
duaelfr’s picture

Status: Needs review » Fixed

This patch has been commited. (Thanks)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.