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.

  • do u want it to appear on the admin main page or within the content options ?? @Silicon – make-me-alive May 11 '16 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. – SiliconMind May 12 '16 at 9:55
0

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
  • Didn't help. But comment module that I checked is also using *.links.menu.yml instead of tasks. – SiliconMind May 13 '16 at 9:18
  • can u also see this link @SiliconMind [link]drupal.org/node/2122253 – make-me-alive May 13 '16 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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