Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm currently in the process of migrating an AngularJS package to v14. One of the key changes involves media retrieval functionality. In Umbraco v12, I had the following code:
if (item.Media) { mediaResource.getById(item.Media).then(function (media) { item.Media = media.mediaLink; }); } else { item.Media = getDefaultImage(item); }
Now, in Umbraco v14, I've updated the code as follows:
for (let item of items) { if (item.Media) { const mediaUrl = await MediaService.getMediaUrls(item.Media); console.log(" item media:", mediaUrl); item.Media = mediaUrl; } else { item.Media = this.getDefaultImage(item); } }
I would appreciate any insights or guidance on
Correct approach for media retrieval in Umbraco v14.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
media retrieval in umbraco v14
I'm currently in the process of migrating an AngularJS package to v14. One of the key changes involves media retrieval functionality. In Umbraco v12, I had the following code:
Now, in Umbraco v14, I've updated the code as follows:
I would appreciate any insights or guidance on
Correct approach for media retrieval in Umbraco v14.
is working on a reply...