Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add menu_item_extras module to GovCMS #267

Open
joshua-graham-adelphi opened this issue Aug 9, 2021 · 8 comments
Open

Add menu_item_extras module to GovCMS #267

joshua-graham-adelphi opened this issue Aug 9, 2021 · 8 comments

Comments

@joshua-graham-adelphi
Copy link
Contributor

joshua-graham-adelphi commented Aug 9, 2021

What value does this module/package add to GovCMS?

[continuation / escalation of https://github.com/govCMS/GovCMS8/issues/319]

joshua-graham-adelphi commented on Aug 26, 2019
Out of the box in Drupal 8, menu items are field-able entities but with "config UI" turned off, this module enables it with new twig templates (but you can use old templates via suggestions_alter() etc.).

Allows extra customization via fields per menu item, per menu + views integration that is not available OOTB.
https://www.drupal.org/project/menu_item_extras

Benefits / use cases:

  • Add Icons per menu item
  • Add a paragraph about this section in the menu
  • Add a title / section html wrapper for menu section (where the section has not menu link / page URL of it's own)
  • Views integration (OOTB Drupal has no views integration)
    • Examples:
      • Most recent added / updated menu items
      • List of all external links (for auditing or maybe a useful links block)
      • Add Entity Reference to menu item + views relationship, now you can pull in landing page content type intro fields!
  • More features such as integration with layout builder (as it requires a fieldable entity) for a WYSIWYG mega menu experience and more! (see project page examples).

Future plans include:

  • Editing a menu item's properties from node edit page
  • etc.

Please provide a brief outline of what this module does.

Sets Drupal menu items to be fieldable, abilities to set view modes, adds a new menu template, add views integration.

Who does this module benefit:

[X] end users - Better UX experience from more design possibilities.
[X] content editors - Less "hack" fields/entities/settings added around the place, e.g. bespoke content blocks, so easier to edit in the right place
[X] site builders - Less "hack" fields/entities/settings, so, just add the field and done!
[X] themers - More Predictable HTML from Drupal templates, easier to override etc.
[X] developers - No more custom code to bypass the menu limitations!

How could you provide/replicate the functionality of this module using alternative methods, eg in your theme?

Custom/hack code - reverse entity reference field from content, taxonomy terms or content blocks to menu item entities and using Drupal menu preprocess hook to inject the fields/HTML. (or just plain hard code the HTML sections/HTML wrappers etc according to predefined order but then content editor can't re-order without needing a developer to edit the twig or JavaScript files).

If this module styles or alters HTML or JavaScript output, can the functionality be provided via the theme? What alternatives have you considered.

See above.

What is the maintenance and support status of the module. Describe the issue queue activity.

Latest Stable release, 7 May 2021, Drupal 8 & 9 compatible.

Lost of issue queue activity.

What permissions are needed to utilise the module (and are any new permissions provided by the module)?

Drupal OOTB adds permissions for fieldable entities. So it has automatically created:

  • Custom menu link: Administer display
  • Custom menu link: Administer fields
  • Custom menu link: Administer form display

No module specific permissions are defined.

Does the module modify the database structure and/or store additional metadata on nodes or other entities? If so, why? What are the risks for future updates?

Any Drupal fields added to menu content entities are removed of the module is uninstalled. (The actual link including OOTB properties remain such title / link / is expanded etc.)

The module currently only stores 1 setting - a flag to manage entity type changes. (not UI user changed, managed on hook_install.)

menu_item_extras.utility.yml

entity_type_build_status: true

Is the module designed to capture anonymous user data?

No.

Is the output of the module typically fully cacheable? Would the inclusion of this module potentially render pages uncacheable.

Yes.

What is your assessment of the quality of this module, the contribution history of the module's maintainers, and the uptake of the module within the Drupal community?

Heavy used by the Drupal community and has many tutorials.

Additional information

Similar modules:

@thisisalistairsaccount
Copy link

Thanks @joshua-graham-adelphi - there's a few things on this module that can be done via CSS but there are some others that might be beneficial or easier to do with this in place, such as the informational text within a mega menu-esque navigation.

Do others in the community see a value to including this or do they see others options that could make this viable as other module or method for including material?

I'll leave this open for consideration in the meantime for those that wish to add their views to this issue

@joshua-graham-adelphi
Copy link
Contributor Author

Hi @thisisalistairsaccount

thoughts about CSS

Some ways I can think of doing it without the module but via CSS is:

  • exposing and then targeting the menu item id via html class (but then you have to create the items in prod first, then down sync the databases to keep the same ids - and pray no one accidentally deletes them in the mean time)
  • Targeting specific Menu item positions via CSS, but then the agency is is now surrendered to the whim of the vendor to change the CSS via git code - not via simple UI admin page. - a PITA as agencies have previously flagged.

I am not sure what you mean by informational text via mega menu-esque navigation? do you mean override drupal templates to or or using link url to force display text in some scenarios ? Or do you mean using CSS to force add static text via HTML pseudo elements (see menu position limitation above) ?

With menu items fields, you can also implement class on the of page under specific link to add some section styling (and instead of being limited to node's tags, which then leaves views pages pages left out) and you can also likely be able to use entity reference hierarchy with it too.

@thisisalistairsaccount
Copy link

Hi community, does anyone have any feedback or views on this module or other considerations? Seeking views from the GovCMS community

@thisisalistairsaccount
Copy link

This module now has a Drupal 10 release and is marked as stable. If anyone else has an interest in this module, please leave a comment on this issue

@joshua-graham-adelphi
Copy link
Contributor Author

I'm still interested in the module. Thanks for making us aware of the stable release. :-)

Everyone please support this module so can have better user experience solutions.

@Gumnutt
Copy link
Contributor

Gumnutt commented Mar 30, 2023

@thisisalistairsaccount I think this is a good module for GovCMS, it provides a bunch of functionality that is is possible with additions to the theme but requires annoying workarounds that are taken away from thanks to Menu Item Extras.

@brett-sargeant
Copy link

I'm not sure we would use it, but can see the usefulness for others.

@dibs
Copy link

dibs commented Aug 22, 2024

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants