Get the parent menu of the node I've a node, which is linked to a sub menu in the main navigation. I would like to get the url and title for the parent menu of the sub menu selected.

I've used it, but it is not working.
I'm trying to use it in hook_node_view()

$node_id = $entity-&gt;id();
      $menu_link_manager = \Drupal::service('plugin.manager.menu.link');
      $result = $menu_link_manager-&gt;loadLinksByRoute('entity.node.canonical', array('node' =&gt; $node_id));
      $build['result'] = $result;
      kint($result);


In twig, I'm calling it as 

{{ content.result }}


But it is not working..
If you want to get the parent of the menu link use getParent():

$menu_link_manager = \Drupal::service('plugin.manager.menu.link');
$links = $menu_link_manager-&gt;loadLinksByRoute('entity.node.canonical', array('node' =&gt; $node_id));
if ($link = reset($links)) {
  if ($parent = $link-&gt;getParent()) {
    $parent = $menu_link_manager-&gt;createInstance($parent);
    $parent_title = $parent-&gt;getTitle();
    $parent_url = $parent-&gt;getUrlObject()-&gt;toString();
  }
}