Create/Edit form -- default the empty menu to a group menu

Created on 17 April 2025, about 2 months ago

Problem/Motivation

When creating group content via the special path or editing via node/nid/edit, nodes without a menu link (both core menu item content and group menu item content) the default menu parent link is set to the main menu (or whatever the defaults for the default-selected and available menu are.

I propose that we add a configurable option to allow menus to default to a group menu instead of a main menu.

There have been far too many times where my group content editors have added something to the main menu when they have access to both group and a wider range of menus on the site.

So when content is being created / edited in a group context I'd like to propose that we update the Node Form Alter to allow selection of the first group menu content is associated with.

Steps to reproduce

Create or use page content type and set default menu to main menu.
Create a group content menu type.
Create a group type.
Add the group content menu type to the group as available content.
Add the page content type as available content.
Configure permissions so the editing user has "administer menus and menu items"
Create a group of this type.
Add a node to the group and observe that menu settings default to main menu.

Proposed resolution

This patch will update the default parent item to be the first available group menu.
This functionality would change default (expected) behavior and should be guarded behind a configuration option.

Remaining tasks

With the patch I have here it doesn't include a configuration form, but I propose we add one to allow this functionality for setting a group menu default. Maybe there's a better way to do it?

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dasginganinja Bethlehem, PA

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

Comments & Activities

Production build 0.71.5 2024