0

I created a Views page and wanted to place it as a secondary task (tab) under admin/content.

I added an entry to my custom module's links.task like this:

mycustom.admin_orphaned_pages:
  title: Orphaned pages
  route_name: view.orphaned_pages.page_1
  parent_id: system.admin_content

and this works to now add a secondary task under the Admin Content page.

The issue is, when I go to this page, it loses the primary (and therefore other secondary) tabs. Is there something missing here?

1 Answer 1

-1

I assume your configuration here is:

  1. The system.admin_content path is '/admin/content'
  2. Your view's path is something not '/admin/content/{your path}'

=> when you access '/admin/content', '/admin/comment' you will see your tab, but when you enter {your path}, the tabs content disapeared.

Quick fix: change your view path to '/admin/content/{your path}' (must include the system.admin_content path as parent here)

Known issue for quick fix: Because your links.task.yml define 'parent_id: system.admin_content' as parent_id, when you access '/admin/content/{your path}, both /admin/content and '/admin/content/{your path} will be set as active.

=> Completed fix:

  • set the path in your view to '/admin/content/{your path}' (or the path if you override system.admin_content path + /{your path})
  • change 'parent_id: system.admin_content' to 'base_route: system.admin_content'
4
  • Ah, sorry, yes, View path is set to /admin/content/orphaned (I assume this would not show up at all on Content page if that was not the case). So I think all of what you said above is basically change parent_id to base_route, correct? That does not fix it (it only changes my page to go to Primary tasks - i think the view does that on its own), and still, when on the page, no pri/sec tasks show.
    – liquidcms
    Feb 20 at 16:27
  • Hmm.. and now it works.
    – liquidcms
    Feb 21 at 19:26
  • If it works, please update the things you made it done. Maybe someone will need it later on. @liquidcms Feb 22 at 1:25
  • Not sure what made it start working. I have what i posted above in the original post.
    – liquidcms
    Feb 22 at 4:46

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.