Skip to content

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

Open
@Bujhm

Description

@Bujhm

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

I read this question #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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions