Navigation block with active class on ul

Created on 3 August 2021, over 3 years ago
Updated 4 September 2024, 5 months ago

Drupal Version: 9.2

Domain module version: 1.0.0-beta6

Expected Behavior

An active class on link of current domain in domain_nav_block block with the Unordered list of links (ul) option

Actual Behavior

No class

Steps to reproduce

* Place DomainNavBlock in your page
* Configure it with "Unordered list of links" (ul) option as "Link theme"
* visit homepage

✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France SylvainM

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡§πŸ‡ͺBelgium tim-diels Belgium πŸ‡§πŸ‡ͺ

    This should be targeted towards the 2.x branch.

  • Merge request !75Add code from MR towards 1.x β†’ (Merged) created by tim-diels
  • Status changed to RTBC 9 months ago
  • πŸ‡§πŸ‡ͺBelgium tim-diels Belgium πŸ‡§πŸ‡ͺ

    I've tested the code and it works as expected, so for me it is RTBC. I created a new MR against 2.x with same code and tested it.

  • Pipeline finished with Success
    9 months ago
    Total: 221s
    #163659
  • Status changed to Needs work 8 months ago
  • πŸ‡«πŸ‡·France dqd London | N.Y.C | Paris | Hamburg | Berlin

    Please do not set RTBC by own patches without review of others.

    Again: Thanks for the report and the work in here. Very much appreciated. But some nitpics:

    -          $items[] = ['#markup' => Link::fromTextAndUrl($label, $url)->toString()];
    +          if ($domain->isActive()) {
    +            $url->mergeOptions(['attributes' => ['class' => 'active']]);
    +          }
    +          $items[] = [
    +            '#type' => 'link',
    +            '#url' => $url,
    +            '#title' => $label,
    +          ];
    

    These changes do not only add active class in case but also change/replace the ['#markup' => Link::fromTextAndUrl($label, $url)->toString()]; without documentation in the issue comments. This should be documented and explained even if obvious for the patch provider, so that follow up issues can better be tracked down and find its root causes.

  • πŸ‡§πŸ‡ͺBelgium tim-diels Belgium πŸ‡§πŸ‡ͺ

    I only added the code that was already provided. but fair enough I follow that I can not set own patches/MR as RTBC.

    What do you need from us to continue in this issue? Some sort of CR so everybody knows what happend and that can be linked in this issue and in the release notes? Or were you thinking about something else?

  • First commit to issue fork.
  • Pipeline finished with Success
    7 months ago
    Total: 193s
    #229273
  • Status changed to Needs review 7 months ago
  • I rebased MR #75 from the current master branch, simplified fix and rewrote the case for testing.

  • Pipeline finished with Success
    7 months ago
    Total: 208s
    #229283
  • Pipeline finished with Success
    6 months ago
    Total: 287s
    #256179
  • Status changed to Needs work 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    Looks good but needs to be rebased.

    Fixing.

  • Status changed to RTBC 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)
  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    agentrickard β†’ changed the visibility of the branch 3226519-navigation-block-with-active-class to hidden.

  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    agentrickard β†’ changed the visibility of the branch 3226519-navigation-block-with-active-class to hidden.

  • Pipeline finished with Skipped
    5 months ago
    #260655
  • Status changed to Fixed 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024