In This Article
openMediaManager
Developer Preview
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Opens the Wix Media Manager in a modal.
The Media Manager allows a site contributor to select one or more of the site's media files.
Signature
Copy
1(options?: {category?: string; multiSelect?: boolean}) => Promise<{items: FileDescriptor[]}>
Parameters
Name | Type | Description |
---|---|---|
options | Options | Optional for the Media Manager. |
Options object
Name | Type | Description |
---|---|---|
category | string | Optional. The type of media files to display in the modal. If this value is empty, all media types are displayed. Supported values: "IMAGE" , "VIDEO" , "MUSIC" , "DOCUMENT" , "VECTOR_ART" , "3D_IMAGE" .By default, all the categories except "3D_IMAGE" are displayed. |
multiSelect | boolean | Optional. Whether multiple files can be selected. Default: false |
Returns
A promise that resolves to an object with a single key called items
. The value of that key is an array of file descriptor objects for the selected media files.
Copy
1Promise<{items: FileDescriptor[]}>
Examples
In order to set up a dashboard client, please refer to the setup guide.
Open a media manager modal
Copy
1const chosenMediaItems = await client.dashboard.openMediaManager({multiSelect: true});2console.log('You have chosen: ', chosenMediaItems.items)
Was this helpful?
Yes
No