Score:0

Display Node Local Tasks Menu on View

jp flag

I have a view that shows registrations for an Event (Content Type). This tab is shown in the /node/{node}/edit:

menuregistrations

This registrations tab refers to the view, which I have inserted in the routing.yml:

events.registrations:
  path: '/node/{node}/registrations'
  defaults:
    _entity_view: 'registrations.page_1'
  requirements:
    _custom_access: '\Drupal\events\Access\EventsRegistrationsAccess::checkAccess'
    node: \d+
  options:
    parameters:
      node:
        type: entity:node

And inserted additionally, events.links.task.yml:

entity.node.registrations:
  route_name: events.registrations
  base_route: entity.node.canonical
  title: 'Registrations'
  weight: 20

Then the view displays the following:

menu-missing

Question: How can I show the menu navigation for the node (same as the first image) on the route '/node/78/registrations' which only shows the view without navigation?

Score:0
jp flag

This was too complicated to attach a navigation menu on a view, instead I used controller that loads a block display from the view programmatically and the navigation was automatically attached.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.