Add tab / local task to a node I've created a module called hotel_reviews.

I've created the route node/{node}/reviews using hotel_reviews.routing.yml. 

hotel_reviews.content:
  path: '/node/{node}/reviews'
  defaults:
    _controller: '\Drupal\hotel_reviews\Controller\ReviewsController::content'
    _title: 'Reviews'
  requirements:
    _permission: 'access content'


I then tried to add a local task using hotel_reviews.links.task.yml.

hotel_reviews.content:
  route_name: hotel_reviews.content
  title: 'Reviews'
  base_route: node.view
  weight: 100


I can now access the content defined by my controller at node/1/reviews, however when I go to node/1 I don't see a reviews tab.

What am I doing wrong?

I've been using the following documentation so far:


D7 to D8 upgrade tutorial: Convert hook_menu() and hook_menu_alter() to Drupal 8 APIs
Providing module-defined local tasks
Structure of routes
Your base route is wrong. You need to use the route that node uses for /node/1. That's not node.view. It's entity.node.canonical.