Allow using Big Menu only on certain menus

Created on 31 January 2024, 8 months ago
Updated 19 September 2024, 9 days ago

Problem/Motivation

I'd love to be able to enable/disable Big Menu functionality on a per-menu basis. We have one monster menu, and the rest are normal-sized enough to be fine with the default menu admin UI (and it would be great to be able to manage those menus with the default UI).

FWIW, if โœจ Improve UI for managing multiple tiers (doesn't currently use AJAX) Active happens, I'd feel more fine about having the Big Menu functionality on all menus, it's just with how the 2.x version of the module works, it gets tedious to manage the overall menu tree (on menus that don't "need" Big Menu for performance reasons).

Steps to reproduce

Proposed resolution

Add configuration to enable/disable Big Menu functionality for each menu on the site.

Remaining tasks

User interface changes

API changes

Data model changes

P.S. Thank you SO much for this menu!! I truly don't know what we would've done if we didn't have it for a monster menu on a monster Drupal 7 site we're upgrading to Drupal 10 ๐Ÿ˜ฌ I mean, we'd have done something custom, but eesh. So grateful for this module ๐Ÿ™Œ

โœจ Feature request
Status

Needs review

Version

2.0

Component

User interface

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States alison

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

Merge Requests

Comments & Activities

  • Issue created by @alison
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev2.addweb

    nilesh.addweb โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review 9 days ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev2.addweb

    Hi, I have added config field to allow certain menus and created MR. Please review it.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States alison

    @nilesh.addweb Thank you! When I apply the patch, though, I no longer have Big Menu functionality on any of my menus -- even after enabling those menus in the Big Menu settings form. I'm not sure why, I don't see any errors in logs, it's just not functioning for me -- did it work for you?

    Besides that, a few other notes:

    1. The first time I go to the settings form, I get a warning in logs (โฌ‡๏ธ). I think it'll be happier if you change the default value (in bigmenu.settings.yml) to { }.
      Warning: foreach() argument must be of type array|object, null given in Drupal\bigmenu\BigMenuForm->buildOverviewForm() (line 62 of /app/web/modules/contrib/bigmenu/src/BigMenuForm.php)
    2. As the patch is currently written, Big Menu is immediately "disabled" on all menus -- site admins have to go to the settings screen and enable menus, in order for Big Menu to keep working.
      • Either there should be an update hook to enable Big Menu on all menus; or,
      • The setting could be revised so that this option is a "negative" option, i.e. checking a box next to a menu would disable it (example: "disable_themes" option in the Chosen module, but this would be menus, of course) (this field in the Chosen module settings is also an example of the checkbox field type); or
      • Allow either way: list the menus with checkboxes next to each one, and then have a "negate this condition" option, like in Block visibility settings. (This option would also need an update hook.)
        • (what I'm referring to) In Block visibility settings > Vocabulary, there's a "negate this condition" checkbox.
    3. I think checkboxes would be better UX for this field, and more consistent with similar fields on Drupal admin forms (instead of a select field).
    4. I think the language would be better as "enabled menus" rather than "available menus", what do you think? (Or "disabled," if you go with the "negative" option.
Production build 0.71.5 2024