我正在尝试以编程方式将自定义parent
面板添加到admin/config
菜单,以便我可以向其添加其他链接,其他模块的配置页面等。该怎么做?例如,我可以在admin/config/development/my_module
下添加自定义模块,但是我想将我的所有模块归入同一custom parent panel
下。
答案 0 :(得分:0)
检入contrib模块以获取示例。消息模块中的示例-message.links.menu.yml
message.overview_templates:
title: 'Message templates'
parent: system.admin_structure
description: 'Manage message templates.'
route_name: message.overview_templates
message.main_settings:
title: 'Message'
route_name: message.main_settings
parent: system.admin_config
description: 'Tools that enhance the user interface.'
weight: -10
message.settings:
title: 'Message'
description: 'Message settings.'
parent: 'message.main_settings'
route_name: message.settings
另外,请查看官方文档:https://www.drupal.org/docs/8/creating-custom-modules/add-a-menu-link