views_menu_children_filter
The Views Menu Children Filter module adds a contextual filter to Views for
showing child nodes of a specified parent node in the menu system. It also adds
a sorting option based on the menu link's weight.
Related core issues
This module helps to work around missing features in core:
- #2777749: Add menu_link_content support into views
- #2315773: Create a menu link field type/widget/formatter
Please help to fix them, so one day these features will be available in core!
Required Modules
The Drupal Core "Views" module is needed.
Installation
- Run
composer require drupal/views_menu_children_filter - Run
drush en views_menu_children_filter
Configuration
When you add the "Menu Children" contextual filter to your custom view, you
can configure the menus you wish to search for inside the filter settings.
Limitations
Currently, this module only works for node entities. Also, the menu links need
to be created inside the node, so they have the "entity:" uri prefix.
"internal:" is NOT currently supported.
Alternative modules
- https://www.drupal.org/project/menu_link (aka #2315773: Create a menu link field type/widget/formatter) which seems most robust
- https://www.drupal.org/project/menu_entity_index (for more advanced cases)
- https://www.drupal.org/project/views_menu_relationship (most lightweight, only for nodes)
- A possible (more powerful) future alternative might be
https://www.drupal.org/project/views_menu_link_content_node_relationship but we didn't have the time to finish it yet.
With #2777749: Add menu_link_content support into views in core, this module might become obsolete! Please help pushing things forward there!