Active
Project:
Views Menu Link Content Node Relationship
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
22 Oct 2025 at 06:09 UTC
Updated:
22 Oct 2025 at 07:05 UTC
Jump to comment: Most recent
In a project I just found the following snippet:
/**
* Implements hook_entity_type_alter to add views menu-link support.
*
* @return void
*/
function MY_MODULE_entity_type_alter(array &$entity_types)
{
/** @var \Drupal\Core\Entity\EntityTypeInterface $menu_link_content */
$menu_link_content = $entity_types['menu_link_content'];
if (!$menu_link_content->hasHandlerClass('views_data')) {
$menu_link_content->setHandlerClass('views_data', 'Drupal\views\EntityViewsData');
}
}
Maybe that would be a helpful first step here? I didn't take a deeper look yet, if it really works and successfully exposes the fields in views. Guess maybe the relation is still missing then?
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:
Comments
Comment #2
anybodyMAYBE that could even be combined with the implementation from https://www.drupal.org/project/views_menu_relationship ?
If that makes sense... to connect nodes with the views data entity handler?
Comment #4
anybodyI'll check #2 and the draft asap.