Problem/Motivation
Providing a Single Link Navigation Block type could be useful for situations where a single item needs to be added to navigation and creating a new menu just for this purpose would be overkill and complex for editors.
A good example of this is the Help link in the current navigation. This is a single link and it was hardcoded in the NavigationUserBlock to avoid creating an extra menu.
If we add this new item, we could migrate Help link to be an usage of this block type and significantly simplify logic in NavigationUserBlock.
Related issues where complexity could be reduced:
#3441576: Investigate using the core "User account menu" in favor of custom Navigation Block for same
#3441118: [PP1] Add the user image to the user menu when available
Steps to reproduce
Current process to add a single link to page Foo in navigation:
- Go to Add Menu Page and create and arbitrary menu called Bar
- Edit the Bar menu and add menu item to Foo and its title
- Go to Navigation Layout page and add a new Bar Menu block
- Configure the Bar Menu Block to use 1st level and depth of 1
- Link to Foo is added to Navigation
Proposed resolution
Create a new Block plugin for use in the navigation, which allows for configuring a navigation block with a single link, rather than having to place a single link with the overhead of creating a menu, setting a link within it, then setting up a navigation block. This would alleviate the present hardcoding of the Help link as noted above, simplifying NavigationUserBlock, and potentially other user cases, also noted above.
Due to UX concerns with this approach, e.g. the potential proliferation of many single link blocks, this new block type will not be available to be added via UI. But created to make the work on the related issues smoother.
Remaining tasks
Update proposed resolutionUpdate change record
User interface changes
None. While we added a new Link block here, it is presently hidden from the general Block layout page as well as the Navigation layout page.
API changes
A new block with machine name navigation_link
was added.
Data model changes
None.