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
Hello everyone.
The item i get from the dialogService.mediaPicker callback. Contains a thumbnail i can use.
dialogService.mediaPicker({ multiPicker: false, callback: myCallback, startNodeId: node.parentId, showDetails: false, onlyImages: true });
So my question is. Is it possible to get the Media thumbnail from entityResource.getById somehow?
entityResource.getById(val, "Media").then(function (item) { myCallback(item); });
Hello,
you can use the "mediaHelper" to get the thumbnail as such:
entityResource.getById(val, "Media").then(function (item) { //only show non-trashed items if (item.parentId >= -1) { if (!item.thumbnail) { item.thumbnail = mediaHelper.resolveFileFromEntity(item); } });
check the mediaHelper with other methods such as getting the thumbnail here: https://umbraco.github.io/Belle/#/api/umbraco.services.mediaHelper
Thank you!
Hi,
I injected mediaHelper into my custom directive, but it is always undefined. Anything special to use it?
angular.module("umbraco.directives") .directive('umbMediaPicker', function (dialogService, mediaHelper, entityResource) {
I am trying to get a url for the image selected by the user.
Thanks
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
entityResource getById Media with thumbnail
Hello everyone.
The item i get from the dialogService.mediaPicker callback. Contains a thumbnail i can use.
So my question is. Is it possible to get the Media thumbnail from entityResource.getById somehow?
Hello,
you can use the "mediaHelper" to get the thumbnail as such:
check the mediaHelper with other methods such as getting the thumbnail here: https://umbraco.github.io/Belle/#/api/umbraco.services.mediaHelper
Thank you!
Hi,
I injected mediaHelper into my custom directive, but it is always undefined. Anything special to use it?
I am trying to get a url for the image selected by the user.
Thanks
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.