You could try to use the code below and see if it goes better.
@{
if (CurrentPage.HasValue("logo")){
var image = Umbraco.Media(CurrentPage.logo);
<img src="/[email protected]&width=200&height=200&quality=90"/>
}
}
I have also added a check to ensure that the image is only printed when there is assigned an item to the picker for the current page that you are visited in the browser. On this way you donĀ“t get any empty src on your image tags.
Get image URL within media custom folder
Hi Guys,
I am trying to get a logo form media library, media->logos(folder)->logoA.png
But i was return with
Cannot resolve a Url for a media item when there is no 'umbracoFile' property defined.
This is my code,
var image = Umbraco.Media(CurrentPage.logo);
<img src="/[email protected]&width=200&height=200&quality=90"/>
If the image is not stored in the logos folder, it works fine.
Is there any kind souls around that can help me out?
Thanks in advance!
Hi Thomas,
You could try to use the code below and see if it goes better.
I have also added a check to ensure that the image is only printed when there is assigned an item to the picker for the current page that you are visited in the browser. On this way you donĀ“t get any empty src on your image tags.
Hope this helps,
/Dennis
Hi Dennis,
Thanks for replying!
I just tried your method but the same error exist.
its triggered by " var imageURL = @image.url; "
I am still confuse, do you know if it's possible for me to store images in a logo folder using Umbraco?
Thanks for helping!
Thomas
is working on a reply...