localgovdrupal/localgov_menu_link_group 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

localgovdrupal/localgov_menu_link_group

Composer 安装命令:

composer require localgovdrupal/localgov_menu_link_group

包简介

Present Drupal's menu links in groups.

README 文档

README

What is it?

This Drupal module allows you to bundle several menu links into a group. This is useful when you want to breakdown a long list of menu links into several smaller groups for better user experience.

As an example, imagine having a long list of content types: Banana, Blackbird, Bat, Cat, Elephant, Magpie, Orange, and Watermelon. If you are using Admin Toolbar Extra Tools or a similar module, these content types will appear as a flat list of menu links under Drupal's Add content menu item. This module can help you group these menu links into severel smaller groups such as the following:

-- Add content
---- Birds
------ Blackbird
------ Magpie
---- Fruits
------ Banana
------ Orange
------ Watermelon
---- Mammals
------ Bat
------ Cat
------ Elephant

Here we have defined the Birds, Fruits, and Mammals groups and decided which menu links belong to each group.

This grouping functionality is not limited to content types only. It can be applied to any menu link.

Usage

  • Install the localgov_menu_link_group module in the usual way.
  • Login as a site admin or any other user with the administer site configuration permission.
  • Head to /admin/structure/menu/localgov_menu_link_group
  • Add a new Menu link group.
  • While adding the group, decide where in the menu tree this group should appear. Choose your selection from the Parent menu link dropdown.
  • Use the Child menu links dropdown to select the menu links that should come under this new group.
  • Save the Group form.
  • A menu link with your choosen group label should appear in the menu tree under your choosen parent menu link. This menu link is not clickable.
  • Hovering over this menu link should reveal its child menu links.

Good to know

  • If you have the multiselect Drupal module installed, the Child menu links dropdown would make use of that resulting in better user experience.
  • The weight value of each group can be adjusted in two ways:
    • From the Group add/edit form.
    • By drag-and-drop from the group listing page at /admin/structure/menu/localgov_menu_link_group
  • The group configurations are fully exportable and importable like any other Drupal configuration file.

Developer notes

Menu link groups are stored as config entities. This means other modules can provide new menu link groups or add menu links to existing menu link groups. The localgov_services module is a good example of a module that defines a new menu link group.

If, on the other hand, we want to add menu links to an existing menu link group, we need to ensure the group_label and parent_menu_link keys in the config file are assigned the same value as the target menu link group and its parent. In the following example, we have copied an existing config item, and are adding two new menu links to the existing Services menu link group with a new config ID localgov_menu_link_group_foo:

langcode: en
status: true
dependencies:
  enforced:
    module:
      - localgov_services
      - localgov_menu_link_group
id: localgov_menu_link_group_foo
group_label: Services
weight: 9
parent_menu: admin
parent_menu_link: 'admin_toolbar_tools.extra_links:node.add'
child_menu_links:
  - 'admin_toolbar_tools.extra_links:node.add.foo'
  - 'admin_toolbar_tools.extra_links:node.add.bar'

The above should go into the localgov_menu_link_group.localgov_menu_link_group.localgov_menu_link_group_foo.yml file and placed within the config/optional/ directory of a module.

Todo

  • Unit tests.

Maintainers

This project is currently maintained by:

localgovdrupal/localgov_menu_link_group 适用场景与选型建议

localgovdrupal/localgov_menu_link_group 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 110.81k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 09 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 localgovdrupal/localgov_menu_link_group 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 localgovdrupal/localgov_menu_link_group 我们能提供哪些服务?
定制开发 / 二次开发

基于 localgovdrupal/localgov_menu_link_group 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 110.81k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 21
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 6
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2020-09-02