Add translatable menu links to we_megamenu

Created on 18 July 2018, almost 7 years ago
Updated 9 January 2025, 5 months ago

Megamenu currently does not allow custom link translations. It would be useful if this module is adapted to use translatable custom links to avoid bloated workarounds.

Use case: a multilingual site has external links in the menu. However, there can only be one translation to the default link. There is no way to add a custom link to the correct site (for example, an English site would link to an external page on another site in English, and the Spanish version would link to its counterpart on the Spanish site.)

The module https://www.drupal.org/project/translatable_menu_link_uri could help out with this, but we_megamenu is not compatible with it. If these modules could work together, it may solve the issue.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇪🇸Spain antonellasev

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States amarshallking

    I got the same issue and I create this patch, works for me, I hope works for someone else

  • First commit to issue fork.
  • Status changed to Needs work 2 months ago
  • 🇮🇳India Tirupati_Singh

    Hi all, I've applied the provided MR as a patch and it applied cleanly without any errors. However, after applying the patch getting below error when configuring the mega menu.

    The website encountered an unexpected error. Try again later.
    
    Error: Call to undefined method Drupal\Core\Menu\MenuLinkDefault::getEntity() in Drupal\we_megamenu\WeMegaMenuBuilder::getMenuTree() (line 48 of modules/custom/we_megamenu/src/WeMegaMenuBuilder.php).
    

    I've also tried applying the patch provided in the comment #4 Add translatable menu links to we_megamenu Active but getting below errors on applying:

    Checking patch src/WeMegaMenuBuilder.php...
    error: while searching for:
                }
              }
            }
          } 
        }
      }
    
    
    error: patch failed: src/WeMegaMenuBuilder.php:448
    error: src/WeMegaMenuBuilder.php: patch does not apply

    I'm attaching the screenshots of before and after of the issue for reference. As the MR is not resolving the issue hence moving back the issue to NW.

Production build 0.71.5 2024