【问题标题】:Drupal 8 Menu Item child of a Task任务的 Drupal 8 菜单项子项
【发布时间】:2019-10-22 17:07:08
【问题描述】:

对于我的自定义 Drupal 8 (8.7.8) 模块,我有以下...

my_module.reports:
  route_name: my_module.reports
  title: 'Reports'
  base_route: my_module.dashboard
  weight: 80

在我的 my_module.links.menu.yml 菜单系统中,它在我正在构建的仪表板上显示为一个选项卡。在那个页面上,我拥有的路由控制器是......

_controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'

我希望在那里列出报告的更多链接。但是这个(来自 my_module.links.menu.yml)...

my_module.reports.territories:
  title: 'Territories'
  description: '...'
  route_name: my_module.reports.territories
  parent: my_module.reports
  weight: 10

不显示。当我转到该页面时,我得到的只是: “您没有任何管理项目。”

我错过了什么?不知何故不可能以这种方式制作任务的孩子,还是这是别的什么?

谢谢!

【问题讨论】:

    标签: drupal-8


    【解决方案1】:

    终于解决了。我还必须添加...

    my_module.reports:
      title: 'Reports'
      parent: system.admin_config
      route_name: my_module.reports
    

    ... 到 my_module.links.menu.yml。然后我可以将链接留在 my_module.links.task.yml 中,以创建我想要的最后一个东西。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多