#StackBounty: #8 #navigation Local tasks not correctly limited to base_route

Bounty: 50

I want to create a customized media library for my editors, with a tab navigation similar to the tabs on core’s admin/content view. It basically works, but I also want to add a tab leading to a specific “media” taxonomy vocabulary used by my media entities. As soon as I add the taxonomy tab to my YML file, the base_route filter no longer works.

Screenshot with correct behaviour on view pages:
Works correctly on view page

Screenshot with unwanted tabs on taxonomy page:
Unwanted tabs on taxonomy page
This is my custom modules’ links.task.yml.

# a common view page for all media types
  route_name: view.medialibrary.medialibrary
  base_route: view.medialibrary
  title: 'All media types'
# a view page only for images
  route_name: view.medialibrary.imagelibrary
  base_route: view.medialibrary
  title: Images
# a view page only for videos
  route_name: view.medialibrary.videolibrary
  base_route: view.medialibrary
  title: Videos
# a view page only for documents/files
  route_name: view.medialibrary.filelibrary
  base_route: view.medialibrary
  title: Documents
# as soon as I activate the following entry, all the tabs are shown
# on every taxonomy overview page, this is not wanted
  route_name: entity.taxonomy_vocabulary.overview_form
    taxonomy_vocabulary: media
  base_route: view.medialibrary
  title: Manage Categories

How can I prevent my custom tabs from appearing on the taxonomy overview pages?

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.