Allow placing links to the end of the list

Created on 14 February 2025, about 2 months ago

Problem/Motivation

Currently when adding items to menus and the menu link weight element is shown, the item is placed to the top of the list. Would be nice to have an option so that the items could be placed to the bottom of the list by default.

There is the form state based "altering" function for doing the reordering, but it might be nice to be able to do this from the UI.

Proposed resolution

Provide and admin-option for setting whether the new links should be placed to the bottom or the top of the menu link weight element.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇫🇮Finland iSampo

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

Comments & Activities

  • Issue created by @iSampo
  • 🇫🇮Finland iSampo

    Attached patch does the following:
    - Provide a new "Place new links as last in the list" checkbox to the admin settings page (/admin/config/user-interface/menu-link-weight)
    - Update the reordering "alter" function to allow placing the items to the "bottom" in addition to the existing "top" option

  • 🇫🇮Finland merilainen

    Looks good to me, existing installations should work with the new configuration without any update hooks. Saving and exporting configuration should be enough.

  • 🇫🇮Finland iSampo

    Here's a new version of the patch, the previous one had an issue where existing menu items could be moved to the bottom as well. This one still includes the update to the "alter" function that allows placing links to the bottom, but it's not used in this patch, but will allow other modules to do so.

  • 🇫🇮Finland iSampo

    How about a patch that actually has everything this time.

  • 🇫🇮Finland merilainen

    Could you include an interdiff between the two patches? Makes reviewing a lot easier.

Production build 0.71.5 2024