Problem/Motivation
Navigation module provides a flexible system to manage the blocks shown in the Navigation Bar. However, it can be confusing for site admins that they have to manually add the Navigation blocks provided by other modules, or even they won't notice that other modules are providing those blocks.
The aim of this issue id to provide a simple system that will allow modules to add Navigation Blocks in a similar way as recipes do in #3478224: Provide Config Action to add new blocks to navigation from recipes. In this way, block are added to the Navigation Bar, and editors afterwards can decide whether the blocks can be moved or removed from the bar.
Dashboard and it's Dashboard block is a good example for this new feature.
Proposed resolution
Create a new hook navigation_deafults that allows to define Navigation blocks that will be added to Navigation when the module providing the logic in installed.
Remaining tasks
Finish definition
Test POC
User interface changes
None
Introduced terminology
None
API changes
Add a new hook defined in Navigation module to declare the default blocks.
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 3491081-nr-bot.txt | 91 bytes | needs-review-queue-bot |
Issue fork drupal-3491081
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3491081-allow-other-modules
changes, plain diff MR !10424
Comments
Comment #3
plopescComment #4
penyaskitoThis would be super useful for a bunch of modules. Not having this logic in navigation means having to duplicate it elsewhere (dashboard that I'm aware, potentially workspaces, environment indicator, etc).
Added some comments, but nothing should be blocking. New feature has test coverage.
Hope this can make it to 11.1.
Comment #5
penyaskitoLGTM then.
Wondering if there should be an issue for adding the 'plugin.manager.config_action' service to core.services.yml to allow autowiring or if this was intentional.
This is not strictly speaking a Drupal CMS blocker as there are workarounds, but definitely is a nice to have.
Comment #6
penyaskitoNeat!
Comment #7
penyaskitoJust remembered about $is_syncing. We don't want duplicated blocks.
Comment #8
plopescI did not realize until you mentioned it. Great catch!
Changes added to the MR.
Comment #9
penyaskitoBack to RTBC
Comment #10
larowlanLeft some minor feedback on the MR, this is really nice!
Comment #11
plopescThank you for your review @larowlan. I think the feedback has been addressed.
Comment #12
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #13
plopescBack to RTBC once conflicts have been solved.
Comment #15
larowlanCommitted to 11.x - thanks
Discussed backport with @catch and decided not needed because this isn't a stable blocker