rstei
01/16/2025, 9:12 AMrstei
01/16/2025, 11:29 AM1amShaw
03/05/2025, 4:00 PMimport { UMB_MEDIA_PICKER_MODAL, UmbMediaUrlRepository } from '@umbraco-cms/backoffice/media';
This'll then go into the component class (I put mine at the very top).
#urlRepository = new UmbMediaUrlRepository(this);
and then get the response when the media modal is submitted.
modalHandler.onSubmit().then(async (response) => {
if(!response) return;
let { data } = await this.#urlRepository.requestItems(response.selection)
console.log(data);
});
* On modal submit we get the response (which is an object with the selection array, property that'll contain the IDs
* Use the #urlRepository and pass the selection array to it and deconstruct the data property from that.A hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by