Ability to display "the menu selected by the page"

Created on 21 October 2019, over 5 years ago
Updated 9 February 2023, over 2 years ago

Issue to keep track of "Ability to display the menu selected by the page" implementation, as described on [Meta] Add missing features to Drupal 8 menu_block โ†’ .

๐Ÿ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

๐Ÿ‡ต๐Ÿ‡นPortugal rutiolma

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.

  • ๐Ÿ‡ธ๐Ÿ‡ชSweden peter tรถrnstrand

    I'm using this patch besides the one in #26 to at least get this thing working descently. But this is by no means done.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium ludo.r Brussels

    Re. #27

    I just ran into the same issue, I guess modifying MenuBlock::getDerivativeActiveTrailIds() should be enough.

      protected function getDerivativeActiveTrailIds() {
        $menu_id = $this->getDerivativeId();
    
        // => If menu_id = "multiple_menu_block", then do custom logic.
    
        return array_filter($this->menuActiveTrail->getActiveTrailIds($menu_id));
      }
    

    In the meantime I'm using classic Menu blocks (from core) and not the multiple one.

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland mitechworld

    Update the patch to support versions equal/greater than v1.8

  • ๐Ÿ‡ต๐Ÿ‡นPortugal jrochate

    Currently none of the patches above works: 1.11

  • First commit to issue fork.
  • ๐Ÿ‡ต๐Ÿ‡นPortugal lolgm

    lolgm โ†’ changed the visibility of the branch 8.x-1.x to hidden.

  • ๐Ÿ‡ต๐Ÿ‡นPortugal lolgm

    lolgm โ†’ changed the visibility of the branch 3089134-ability-to-display to hidden.

  • ๐Ÿ‡ต๐Ÿ‡นPortugal lolgm

    lolgm โ†’ changed the visibility of the branch 3089134-ability-to-display to active.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.1 + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Unable to generate test groups
  • Pipeline finished with Success
    about 1 year ago
    Total: 232s
    #185147
  • ๐Ÿ‡ต๐Ÿ‡นPortugal lolgm

    I created !MR22 for version 1.11, based on previous patches.
    I also implemented a proposed solution to the block title, problem referred in #27 and #28.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 8
    last update about 1 year ago
    11 pass
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.1 + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Unable to generate test groups
  • Pipeline finished with Success
    about 1 year ago
    Total: 314s
    #186969
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland mitechworld

    mitechworld โ†’ changed the visibility of the branch 8.x-1.x to active.

  • Status changed to Needs review 12 months ago
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.1 + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    Patch Failed to Apply
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.1 + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    Patch Failed to Apply
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium weseze

    MR22 works fine. (tried the patch from it against latest release)

    Can we get feedback from the maintainers?

  • ๐Ÿ‡ต๐Ÿ‡นPortugal lolgm

    @weseze Thanks for the feedback.

    Using this functionality I found two use cases where the implementation was incomplete.

    1st - When a node is present in more than one menu, it is not possible to "prioritize" a menu to be the active one.

    2nd - When the current node is not present in any menu, and if the option "Hide on pages not included in menu" is not activated, the expected behavior is to render the default menu, however the default menu in the multiple block is the first menu from the configuration list, may not be the intended default.

    These two limitations occur due to the block configuration format being just a table with select, not sortable.

    In this way, I converted the selection table into a table with the option of dragging, so that it is now possible to select the menus you want and classify them in order of "priority".
    Therefore, the first menu selected will also be the default menu if there is no active menu on the current node.

    Attention!!!
    This is a breaking change.
    To be able to make this change, the format in which the selected menus were being saved in the block configuration changed, according to my tests, the only problem is having to configure the multiple menu blocks again.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.1 + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    Patch Failed to Apply
  • ๐Ÿ‡ต๐Ÿ‡นPortugal lolgm

    Patch of changes described in #41

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.1 + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    Composer require failure
  • ๐Ÿ‡ต๐Ÿ‡นPortugal lolgm

    Patch #42 is incomplete, this is the patch with changes #41.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium weseze

    Please don't make breaking changes that require manual work to fix... This is a hell when maintaining 100's of sites.
    Can't we instead create an update/post_update/deploy hook to fix things?

  • ๐Ÿ‡ต๐Ÿ‡นPortugal lolgm

    I think I explained myself badly.

    The breaking change I mentioned is in relation to the previous patches in this issue, that is, the block MultipleMenuBlock (multiple_menu_block) which is under development and will be added in this issue.

    In this new patch that I suggested, the MultipleMenuBlock will undergo a change in its configuration, so if someone is going to test this new patch on the same instance that tested one of the previous ones, they will have to configure the block again to update its config.

    That said, I don't think an update hook is applicable here as it only concerns changes to the component under development.

  • ๐Ÿ‡ต๐Ÿ‡นPortugal jrochate

    Doesn't work on latest 1.13

  • ๐Ÿ‡ต๐Ÿ‡นPortugal lolgm

    Reroll #43 to 1.13.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium weseze

    patch 47 works fine for us. (it did need manually updating the block settings from previous patch...)

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium giaz

    This patch builds on 3089134-26.patch ( v1.10 ) and adds multilingual awareness to the MultipleMenuBlock.

    Note: If none of the selected menus are appropriate for the current language, the block renders nothing, avoiding irrelevant menus.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium giaz

    wrong paths and trailing spaces in menu_block_multiple-3089134-49.patch

    Fixed in menu_block_multiple-3089134-50.patch

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada joelpittet Vancouver

    It looks like a lot of people might be interested in this feature. Could someone update the MR with the latest patch?

    Also looking at the latest patch, it seems to be about language code, maybe this needs to be separated to a new issue, what problem are we solving here?

Production build 0.71.5 2024