Score:0

Custom links.task for secondary tab loses primary tabs

us flag

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?

Score:-1
sa flag

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'
liquidcms avatar
us flag
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 avatar
us flag
Hmm.. and now it works.
Trà Dương avatar
sa flag
If it works, please update the things you made it done. Maybe someone will need it later on. @liquidcms
liquidcms avatar
us flag
Not sure what made it start working. I have what i posted above in the original post.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.