0

parent: system.admin_content route handles /admin/content path. I'm trying to add more items to the menu tabs visible on that page.

/admin/conntent

So I'm doing this:

# test.routing.yml
entity.admin.test:
  path: '/admin/content/test_entity'
  defaults:
    _entity_list: 'test_entity'
    _title: 'Test entities'
  requirements:
    _permission: 'administer content types'

# test.links.menu.yml
test.admin:
  title: Test entities
  route_name: entity.admin.test
  # I have also tried using route defined in my entity type annotation
  # route_name: entity.test_entity.collection
  parent: system.admin_content
  description: 'List and edit site test entities.'

The route works (I can access page at /admin/content/test_entity), but menu item is not displayed. If I change parent to for example system.admin_structutre then the menu item is shown on /admin/structure list without problems.

2
  • do u want it to appear on the admin main page or within the content options ?? @Silicon Commented May 11, 2016 at 19:11
  • @make-me-alive I want it to appear as a tab on /admin/content page next to "Content" and "Files" tabs as shown on the image that I've attached. Commented May 12, 2016 at 9:55

1 Answer 1

1

Dont use test.links.menu.yml instead use test.links.task.yml

in test.links.task.yml try the below code...

entity.admin.test:
  title: 'Test entities'
  route_name: entity.admin.test
  description: 'List and edit site test entities.'
  base_route: system.admin_content
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.