It would be great to be able to add metafields to menu items.
Examples of two very common use cases that it would allow implement:
Adding a banner inside of a mega menu. Defining a metaobject for menu banners and then referencing it in a menu item’s metafield would make implementing such banners much easier, more straightforward and less hacky.
Hey folks,thanks for the feature request, happy to log this on our side. Just to make sure I’m capturing this properly on our end, are you mainly looking at things like attaching promotional banners or images to specific menu items in a mega menu? Or is it more about adding custom labels/headings to organize submenus? (Or a bit of both?)
For example, is the main goal being able to flag certain items like “Sale” for custom styling directly from the menu editor?
The more detail the better here, really helps when surfacing these! Let me know!
In my case the main goal is to be able to attach/tie image banners and headings to specific menu items.
Let’s say I want to add different banners to different menu items. They should appear in the mega menu. Different menu items might have different banners. To achieve this with current Shopify/liquid capabilities I need to come up with some hacky logic. For example, I have a metaobject for the Image banners with next fields (Image, Text, Link, Attach to). The Attach to field holds a text line which equals to the menu item text. Next in the megamenu’s liquid I go through each Image banner metaobject and check if the Attach to field has the same value as my current menu item and if it does I display the banner. This logic is obviously prone to mistakes and hacky. If I just could attach a metafield with metaobject reference to a menu item, it would make things so much easier, straightforward and less error prone.
The next use case is subheadings for submenus in the mega menu. For example:
T-Shirts menu item with next submenu headings:
Color Price
Red Under $20
Blue Under $40
Green Above $40
Also metafields would allow adding “badges” to menu items more easily. For example, Sale, Trending, etc.
Hey @Serhii, this is super helpful, really appreciate you laying that out. The subheadings and badges use cases make a lot of sense. I’ve gone ahead and logged this on our end with all the context you and @ceri_waters provided. I can’t share a timeline on this or guarantee a change, but the detail here really helps when surfacing these internally. Thanks again, and let me know if anything else comes up!