Add compatibility with other fields extras

Created on 29 May 2023, over 1 year ago
Updated 9 July 2024, 6 months ago

Problem/Motivation

I was looking for ways to add fields to the menu and I found the following 3 alternatives:

https://www.drupal.org/project/menu_item_extras
https://www.drupal.org/project/menu_item_fields
https://www.drupal.org/project/menu_link_content_fields

and I saw that none of them is compatible with tb mega menu and the possibility that any of the modules is compatible with tbmegamenu would be a great addition to the menu

Feature request
Status

Active

Version

2.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @Nelo_Drup
  • 🇺🇸United States banoodle San Francisco, CA

    I just want to chime in here in case it is helpful to others.

    We added a field_link_icon field to our menu links using the menu_item_fields module.

    We want to display this icon in tb_megamenu along with the menu links.

    As noted in this issue, there doesn't appear to be a way through the UI/config to do this.

    We were able to achieve this by adding the following to our theme's tb-megamenu-item.html.twig (and installing the twig_tweak module):

     {% set media_id = item.link.entity.field_link_icon.0.target_id %}
    {{ drupal_image(media_id, 'thumbnail', {alt: ''}) }}

    Thanks to @nkarhoff for helping me with this solution!

Production build 0.71.5 2024