Hi, I am having trouble with getting an image from a media picker.
I am fairly new to Umbraco but the last site a created with Umbraco 7 I used simply ... @Umbraco.Media(CurrentPage.BackgroundImage).GetCropUrl("banner")
however trying this is the latest version, the url is always blank.
When I debug and view the properties everything seems to be in order.
Even the url /media/1051/testimage.jpg displays the correct image.
The crop is setup in the ImageCropper and definitely the correct name.
I have also tried without cropping and that still doesn't work.
I'm sure it'll be something very simple but any advice would be very welcome.
I have tried using your suggestiong but ended up with the error ...
Umbraco.Web.Models.PublishedContentWithKeyBase' does not contain a definition for 'GetCropUrl'
However if I use just @CurrentPage.BackgroundImage.Url the image is at least loading so phew for that but do you have any idea why I can't use GetCropUrl()
Dynamic Media not working
Hi, I am having trouble with getting an image from a media picker. I am fairly new to Umbraco but the last site a created with Umbraco 7 I used simply ...
@Umbraco.Media(CurrentPage.BackgroundImage).GetCropUrl("banner")
however trying this is the latest version, the url is always blank. When I debug and view the properties everything seems to be in order.
Even the url /media/1051/testimage.jpg displays the correct image.
The crop is setup in the ImageCropper and definitely the correct name. I have also tried without cropping and that still doesn't work.
I'm sure it'll be something very simple but any advice would be very welcome.
Thanks
Hi Sarah
What version of Umbraco are you using?
If you use > 7.6 version, try to use like here:
@CurrentPage.BackgroundImage.GetCropUrl("banner")
Since 7.6 Property Value Converters are part of the core, so you don't need to use extra Umbraco.Media call.
Thanks,
Alex
Thanks Alex.
I am using the latest version 7.6.3.
I have tried using your suggestiong but ended up with the error ...
Umbraco.Web.Models.PublishedContentWithKeyBase' does not contain a definition for 'GetCropUrl'
However if I use just @CurrentPage.BackgroundImage.Url the image is at least loading so phew for that but do you have any idea why I can't use GetCropUrl()
Thanks again. Sarah
is working on a reply...