mattmilburn / strapi-plugin-menus

A plugin for Strapi CMS to customize the structure of menus and menu items.
MIT License
110 stars 27 forks source link

How to add menu as relation for the component? #158

Open Bujhm opened 4 months ago

Bujhm commented 4 months ago

How can I add a menu as a relation on the component side?

I read this question https://github.com/mattmilburn/strapi-plugin-menus/issues/90 but it doesn't help me (

Here is what I made and what I got:

I added the relation on the component side (added the relation to attributes section): "attributes": { "homepageLockupText": { "type": "string" }, "homepageLockupImage": { "type": "media", "multiple": false, "required": false, "allowedTypes": [ "images" ] }, "homepageLockupLink": { "type": "string" }, "page": { "type": "relation", "relation": "oneToOne", "target": "api::page.page" },

"menuItems": {

  "type": "relation",
  "relation": "oneToOne",
  "target": "plugin::menus.menu-item"
  }

} }

I've got next result: Monosnap+Content-Type+Builder+-+Google+Chrome+2024

The question is: How the get not only Id, but also and menu titles Monosnap+Image+2024-04-17+19 21 13

I tried almost all, I think ;-) Appreciate for any help!

PS: the plugin is awesome!