Add support for Linkset functionality being added to core

Created on 2 July 2022, almost 2 years ago
Updated 20 June 2024, 8 days ago

Problem/Motivation

There is a core patch β†’ currently marked RTBC to create a system path for each menu that returns standard Linkset format, which is useful for decoupled systems. The route is /system/menu/{menu}/linkset with menu being the machine name of the menu requested.

Since group menus are not "menu" entities, but "group_content_menu" entities, they are not renderable using this core functionality.

Proposed resolution

The attached patch adds the same functionality to each group menu, but at a new path `/system/groupcontentmenu/{id}/linkset` where "id" is the numerical id of the group_content_menu entity.

Steps to reproduce

  1. Apply the core patch #3227824
  2. Enable the functionality at /admin/config/services/linkset
  3. Visit an example menu for reference, like `/system/menu/admin/linkset` to see the output.
  4. Visit one of your group menus `/system/menu/1//linkset` and get "Page not found"
  5. Apply this patch
  6. Visit the new path `/system/groupcontentmenu/1/linkset` and see the Linkset output of the group content menu.
  7. For multilingual sites, prepend the language prefix to see the translated menu.

Example output

{"linkset":[{"anchor":"\/system\/groupcontentmenu\/1\/linkset","item":[{"href":"\/example-link","title":"Example English Link","hierarchy":["0"],"class":[""],"machine-name":["group_menu_link_content-1"]}]}]}

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jessehs Taos, New Mexico

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024