Strapi Menu Plugin - media field missing in api

Hi,
I use the Strapi Plugin Menus (Menus | Strapi Market) and it works fine.

I did set up some additional fields, which also works fine, but I’m not able to get the media field in the api, it just does not populate.

All the other fields work fine, my cloudinary connection works fine, images are uploaded and stored in the database, it just does not apply in the api.

Maybe somebody can help me out here. Thank you

This is my code for the additional fields in plugins.js

 menus: {
    config: {
      maxDepth: 3,
      layouts: {
        menuItem: {
          english: [
            {
              input: {
                label: "Titel",
                name: "title_ke_EN",
                type: "text",
                description: "The menu title in english",
              },
            },
            {
              input: {
                label: "URL",
                name: "url_ke_EN",
                type: "text",
                description: "The menu url in english",
              },
            },
          ],
          swahili: [
            {
              input: {
                label: "Titel",
                name: "title_ke_SW",
                type: "text",
                description: "The menu title in swahili",
              },
            },
            {
              input: {
                label: "URL",
                name: "url_ke_SW",
                type: "text",
                description: "The menu url in swahili",
              },
            },
          ],
          media: [
            {
              input: {
                label: "Media",
                name: "menu_media",
                type: "media",
              },
            },
          ],
        },
      },
    },
  },
  upload: {
    config: {
      provider: "cloudinary",
      providerOptions: {
        cloud_name: env("CLOUDINARY_NAME"),
        api_key: env("CLOUDINARY_KEY"),
        api_secret: env("CLOUDINARY_SECRET"),
      },
      actionOptions: {
        upload: {},
        delete: {},
      },
    },
  },
  // ...
});

and this is my code for the additional fields in strapi-server.js

  const customAttrs = {
    title_ke_EN: {
      type: "string",
    },
    url_ke_EN: {
      type: "string",
    },
    title_ke_SW: {
      type: "string",
    },
    url_ke_SW: {
      type: "string",
    },

    menu_media: {
      type: "media",
      allowedTypes: ["images"],
      multiple: false,
    },
  };
1 Like