In case this helps progress the last suggestion

Drupal 8

The menu blocks are in core for Drupal 8. Each menu has a corresponding block that is managed on the Block layout page. The configuration options provided by this are:
Initial menu level: The menu will only be visible if the menu item for the current page is at or below the selected starting level. Select level 1 to always keep this menu visible.
Maximum number of menu levels to display: The maximum number of menu levels to show, starting from the initial menu level. For example: with an initial level 2 and a maximum number of 3, menu levels 2, 3 and 4 can be displayed.

Comments

larowlan’s picture

planning to work on it during DrupalSouth code sprint repo here https://drupal.org/project/2169967

kim.pepper’s picture

Title: Port to Drupal 8 » [meta] Port to Drupal 8
Issue tags: +#drupalsouth
askibinski’s picture

Typo in link mentioned in #1, should be:
https://drupal.org/node/2169967

s_leu’s picture

Hi i was working on the D8 port a bit today. I don't have access to the sandbox so i pushed my changes to github: https://github.com/md-systems/menu_block . Could you please give me access to the sandbox such that i can push my changes? Please consider my changes on github if you work on this until i pushed my changes to the sandbox repo.

larowlan’s picture

Hi
We switched to github, github.com/larowlan/menu_block - can you send a PR against that.

Lee

s_leu’s picture

Ok i created a pull request at https://github.com/larowlan/menu_block/pull/4

cheers

kattekrab’s picture

If this is happening in github - is there an update for this issue?

Dave Reid’s picture

https://github.com/larowlan/menu_block hasn't been changed in the last 11 months, so I doubt it still works with the latest D8. Would be good if we could start actually getting some patches submitted back here instead.

kim.pepper’s picture

The basic menu_block functionality is now in core, so it's not a straight port. We need to define what features we want in the contrib module.

Dave Reid’s picture

I also wonder if menu_block could just alter the existing core menu block behavior to support the additional features, or if we have to provide its own plugin and keep them separate. I'd prefer the former if possible.

Berdir’s picture

Config schema is going to make that hard, I don't think it is possible to say that an existing plugin has more configuration keys. There's third party settings, but those are on the config entity and a block plugin shouldn't rely on that (because page manager for example uses and stores block differently).

nerdstein’s picture

I recently audited this in core and it seems like a near identical port.

Should there be a notice on the project page about how this functionality has moved into core in D8? I think this would be beneficial for people to see.

petednz’s picture

Issue summary: View changes

Some explanation would be much appreca

axe312’s picture

I needed the functionality to expand all menu items. Since there is no D8 port of this module yet, I created one which we can hopefully replace later on with menu_block:

https://github.com/axe312ger/expanded_menu_block

Hope thats useful for someone else :)

safetypin’s picture

Is the "expand all children" feature included in the menu_block port to Drupal 8 core? I don't see an option to do that in the blocks.

@axe312: is expanded_menu_block functional with 8.0.1?

cferthorney’s picture

@axe312 - any idea on if you'll make that a sandbox - expand all children is exactly what I am after. If menu_block isn't going to get an official port - maybe we need a contrib module of expanded_menu_block or similar. @safetypin I'll try it on a test site and fork and fix on github when I get time (Maybe the January 2016 global sprint weekend on 30/31 Jan 2016)

Lukas von Blarer’s picture

expanded_menu_block works perfectly. Should we use it as a base for this D8 port?

Danny Englander’s picture

I just tested the Github module from #14 and that works great. Thank you @axe312.

duntuk’s picture

Yeah, expanded_menu_block provides an "Expand all childs" ability, however, we still need the the most useful functionality of selecting the "Fixed parent item", as is available in the 7.x version under "Advanced".

joos’s picture

Yes, the menu_block in core is stripped of some rather necessary features. Expand + fixed parents is really nice to have from time to time, footer links and sitemaps pages. Larger sites need the follow trail and sort items feature aswell. The moduler should perhaps be named "menu_block_advanced" or something that doesnt excluded featuers in the name.

Lukas von Blarer’s picture

No, lets not create a new module. menu_block seems to be the right place to do this, right?

kattekrab’s picture

Would it make any sense to try and get that feature added to Core? Perhaps for 8.2?

cferthorney’s picture

The main features offered by the module (to my mind) is the fixed parent and default to expanded within the block without it needing to be set on the menu. It would be nice to see this in core, but I also think we need an 8.x-1.x release before it is likely to be considered for core (Thinking along the lines of big_pipe). What are others thoughts? Push with 8.x-1.x and try core for 8.2 or beyond? Or just push for core now?

mandclu’s picture

I like the idea of having an 8.x-1.x release. There's a definite appetite for the features that didn't make it into core already, but we can't predict whether or not that will be enough for them to be adopted into core even if developed. With an 8.x-1.x release those of us that need the features can start using them, regardless of the outcome of the core discussion.

kattekrab’s picture

So! What we need now is code :-)

biggm’s picture

We have a project now that desperately needed the "fixed menu parent" feature. We ended up writing a custom module and hardcoded the menu machine names into yml files.

Once we've recoded it to query the DB based off of a configuration screen, we'll post the Github repo here. Let me know if that might be helpful for anyone.

rknox’s picture

^ I could really use that biggm.

In the meantime, I'm using the patch at the link below which adds "Make the starting level follow the active menu item" functionality. Not ideal for a fixed parent solution, but it's working for those instances where you need to just follow the parent.

https://www.drupal.org/node/2631468#comment-10941953

cbovard’s picture

Any status on the "Fixed Parent" selection from the original pre D8 Module? Thanks in advance.

rrrob’s picture

I added the "fixed parent" option to https://github.com/robdecker/menu_block_ex

  • larowlan committed 392ba56 on 8.x-1.x
    Issue #2141119 by larowlan: Todo notes for services
    
  • larowlan committed 3dbaddd on 8.x-1.x
    Issue #2141119 by larowlan: Uninstall cleanup much simpler
    
  • larowlan committed 412de27 on 8.x-1.x
    Issue #2141119 by larowlan: move menu_block_get_all_menus() to service
    
  • jibran committed 415e55d on 8.x-1.x
    Issue #2141119 by jibran: Fixed warnings, default config file and route...
  • larowlan committed 4303492 on 8.x-1.x
    Issue #2141119 by larowlan: cleanup theme level warnings
    
  • larowlan committed 5c2272e on 8.x-1.x
    Merge pull request #1 from larowlan/add-_menu_block_access
    
    Issue #...
  • jibran committed 5d73abb on 8.x-1.x
    Issue #2141119 by jibran: Updated repository interface and service with...
  • larowlan committed 6043bdd on 8.x-1.x
    Issue #2141119 by larowlan: Move JavaScript
    
  • larowlan committed 7436572 on 8.x-1.x
    Issue #2141119 by larowlan: Remove hook_theme() wrapper
    
  • larowlan committed 8133642 on 8.x-1.x
    Issue #2141119 by larowlan: Port to new Block plugin
    
  • larowlan committed 82e1ad6 on 8.x-1.x
    Issue #2141119 by larowlan: Yaml for info file
    
  • larowlan committed 86f6144 on 8.x-1.x
    Issue #2141119 by larowlan: Move menu block config form to form object,...
  • larowlan committed 918a5fd on 8.x-1.x
    Issue #2141119 by larowlan: Remove export module, thanks CMI
    
  • jibran committed 9334015 on 8.x-1.x
    Issue #2141119 by jibran: Fixed route access.
    
  • larowlan committed b4bff22 on 8.x-1.x
    Issue #2141119 by larowlan: Move CSS
    
  • larowlan committed bea79f8 on 8.x-1.x
    Issue #2141119 by larowlan: cleanup duplicate block subjects
    
  • larowlan committed d4ef2d0 on 8.x-1.x
    Issue #2141119 by larowlan: fix errors in call to menu_parent_options()
    
  • jibran committed d60f411 on 8.x-1.x
    Issue #2141119 by jibran: Fixed invalid syntax in menu_block.services....
  • larowlan committed dbbdbfe on 8.x-1.x
    Issue #2141119 by larowlan: Remove api no longer needed, thanks CMI
    
  • larowlan committed dcf04b6 on 8.x-1.x
    Issue #2141119 by larowlan: Wrapper template to twig
    
  • larowlan committed e39261a on 8.x-1.x
    Issue #2141119 by larowlan: Add repository interface and move constant...
  • larowlan committed eb82a7e on 8.x-1.x
    Issue #2141119 by larowlan: UNSTABLE: Splits MenuBlockRepository up,...
  • jibran committed 2770181 on 8.x-1.x
    Issue #2141119 by jibran: Fixed menu_block utilities location.
    
  • kim.pepper committed 3809731 on 8.x-1.x
    Issue #2141119 by kim.pepper: Remove unused theme function
    
  • kim.pepper committed 58deb49 on 8.x-1.x
    Issue #2141119 by kim.pepper: Remove ctools block support
    
  • kim.pepper committed 593718e on 8.x-1.x
    Issue #2141119 by kim.pepper: Typehint on ConfigFactoryInterface
    
  • kim.pepper committed 628d2a6 on 8.x-1.x
    Issue #2141119 by kim.pepper: Move images to images folder
    
  • kim.pepper committed 70024fb on 8.x-1.x
    Issue #2141119 by kim.pepper: Let themes add classes they need
    
  • kim.pepper committed 7adaf65 on 8.x-1.x
    Issue #2141119 by kim.pepper: Teach hook_help to work with route names
    
  • kim.pepper committed 83e257c on 8.x-1.x
    Issue #2141119 by kim.pepper: Fix for hook_menu_link_defaults
    
  • kim.pepper committed 98315b1 on 8.x-1.x
    Issue #2141119 by kim.pepper: Fixed bug with data not being returned
    
  • kim.pepper committed c275f18 on 8.x-1.x
    Merge pull request #2 from larowlan/2141119-menu-block-links
    
    Issue #...
  • kim.pepper committed cec080d on 8.x-1.x
    Issue #2141119 by kim.pepper: Convert hook_menu to...
  • kim.pepper committed d48f751 on 8.x-1.x
    Issue #2141119 by kim.pepper: Remove contextual links for book
    
  • kim.pepper committed d942e0f on 8.x-1.x
    Issue #2141119 by kim.pepper: Remove menu_block.install
    
  • kim.pepper committed e606281 on 8.x-1.x
    Issue #2141119 by kim.pepper: Removed unused sort helper
    
JohnAlbin’s picture

I just merged all the work in https://github.com/larowlan/menu_block into this project. I'm pretty sure most of that work got refactored and put into Drupal 8 core, but I'd like to recognize that work by merging it in here as well.

@rrrob I wasn't sure if your code was GPLv2. But I just compared menu_block_ex to SystemMenuBlock in core and it is clear that your code was forked off of Drupal 8 core, and, therefore, is also GPLv2. I tested your code and it works great! I'm going to merge it in too. Do you want to be a maintainer of Menu Block?

JohnAlbin’s picture

Version: 7.x-3.x-dev » 8.x-1.x-dev

  • JohnAlbin committed 194b91a on 8.x-1.x authored by rrrob
    Issue #2141119: Add parent menu item option
    
  • JohnAlbin committed b6a3e28 on 8.x-1.x
    Issue #2141119: Convert t() to $this->t() in MenuBlock->blockForm().
    
  • JohnAlbin committed bbbfb6a on 8.x-1.x
    Issue #2141119: Make MenuBlock extend SystemMenuBlock.
    
rrrob’s picture

@JohnAlbin yeah I'll be a maintainer. Thanks

  • JohnAlbin committed 03d6daf on 8.x-1.x
    Issue #2141119: Remove code for unimplemented features. @TODO Revert...
  • JohnAlbin committed 2c94ed5 on 8.x-1.x
    Issue #2141119: Open details field sets when config is not default.
    
  • JohnAlbin committed 3936b0a on 8.x-1.x
    Issue #2141119: Make expand and parent options properly alter the menu...
  • JohnAlbin committed 3a308be on 8.x-1.x
    Issue #2141119: Fix "parent" form element.
    
  • JohnAlbin committed 409c567 on 8.x-1.x
    Issue #2141119: Remove unneeded CSS and JS.
    
  • JohnAlbin committed b97feb0 on 8.x-1.x
    Issue #2141119: Update help text in block form.
    
  • JohnAlbin committed e8cff57 on 8.x-1.x
    Issue #2141119: Add missing base class use statement.
    
JohnAlbin’s picture

Status: Active » Fixed

I removed any code for unimplemented features. We can revert this commit later and then finish those features. https://www.drupal.org/commitlog/commit/6358/03d6daf78884ff9d6eb3ea28262...

These features have not been ported:

  • All of the old API hooks
  • Ability to suppress menu blocks provided by System module.
  • Ability to display "the menu selected by the page"
  • Block title as link
  • Administrative title
  • Make the starting level follow the active menu item
  • Sort menu tree by the active menu item’s trail

Status: Fixed » Closed (fixed)

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

JohnAlbin’s picture

@rrob Welcome aboard! I gave you maintainer privileges last month, but forgot to mention it!