Support menu items via Views

Created on 11 December 2023, 11 months ago
Updated 29 April 2024, 7 months ago

Problem/Motivation

If you have a View, and add a menu item via a View (Level 2 below) and arrange the item in a hierarchy for example in the "Main navigation" menu, the menu hierarchy is not transfered and the menu item is shown as a top menu item, when it should be under another menu item.

Level 1
    Level 2

Shown like this:

Level 1
Level 2

This happens because the module deletes the whole structure before import, so the View loses the parent upon import and gets a new ID and UUID, which Views is not aware of.

Steps to reproduce

Add a menu item in a View using hierarchy giving it a parent, export and import, and see that the menu item is placed at the root.

Proposed resolution

Support exporting and importing menu items from Views.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Closed: won't fix

Version

2.0

Component

Code

Created by

🇩🇰Denmark ressa Copenhagen

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

Comments & Activities

  • Issue created by @ressa
  • 🇷🇴Romania bbu23

    Agree about looking into Views, because I don't remember/know if they are MenuLinkContent, but Taxonomy Menu will never happen because they don't use MenuLinkContent, they have their own entity and it's generated/updated when taxonomies are added/updated. It's impossible to do that, and my module (as stated in the description) only handled MenuLinkContent.

    The only thing that could involve the Taxonomy Menu is if the taxonomy menu tree is below a MenuLinkContent, which is a case that I am having, but not sure yet if this can be handled. We'll see. Thanks for updating the issues.

  • 🇩🇰Denmark ressa Copenhagen

    Thanks for clarifying, I'll remove Taxonomy from the issue.

  • Status changed to Closed: won't fix 7 months ago
  • 🇷🇴Romania bbu23

    After investigating, the Views menu links are not MenuLinkContent, they are ViewsMenuLink plugins, similar to taxonomy menus, therefore this is out of scope as this module strictly covers MenuLinkContent entities. As discussed previously, people are advised to manually create the menu items instead of going through views if they wish to have them included in the export/import hierarchy.

  • 🇩🇰Denmark ressa Copenhagen

    Thanks for investigating this @bbu23. Not defining menus in Views is a totally acceptable workaround, in order to have a great, well functioning menu export-import tool.

Production build 0.71.5 2024