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 am working on Umbarco 7.6.5 but not able to show image using umbraco.media(id of the image). is there something i am missing here.
Manish
Hi Manish,
They changed the way the Media Picker works.
This is how I did it:
var msPartner = @Umbraco.Media(root.GetPropertyValue("microsoftPartnerLogo").ToString()).Url;
Hi,
Do not use dynamics :) Something like that is better:
if (root.HasValue("microsoftPartnerLogo")) { var msPartner = Umbraco.TypedMedia(root.GetPropertyValue<int>("microsoftPartnerLogo")).Url; }
Manish, did you solve the issue?
Thanks, Alex
Hi Manish
The problem can be with Property Value Converters, it's part of the core now.
And you can access images without calling Umbraco.Media
Just use CurrentPage.imagePropertyAlias.Url
Can you show the code that doesn't work for you?
Thanks,
Alex
An alternative approach to try is TypedMedia. You can use something like this within an src value of a img element...
@Umbraco.TypedMedia(2057).Url
Because it returns a IPublishedContent Media entity, you can also use other built-in properties listed here.
IPublishedContent
I am using arche type and taking image inside.
Please update on this?
Did you check this topic? https://our.umbraco.org/forum/using-umbraco-and-getting-started/85303-umbraco-76-and-media They are using Archetype as well.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to show images in Umbarco 7.6.5
I am working on Umbarco 7.6.5 but not able to show image using umbraco.media(id of the image). is there something i am missing here.
Manish
Hi Manish,
They changed the way the Media Picker works.
This is how I did it:
var msPartner = @Umbraco.Media(root.GetPropertyValue("microsoftPartnerLogo").ToString()).Url;
Hi,
Do not use dynamics :) Something like that is better:
Manish, did you solve the issue?
Thanks, Alex
Hi Manish
The problem can be with Property Value Converters, it's part of the core now.
And you can access images without calling Umbraco.Media
Just use CurrentPage.imagePropertyAlias.Url
Can you show the code that doesn't work for you?
Thanks,
Alex
An alternative approach to try is TypedMedia. You can use something like this within an src value of a img element...
Because it returns a
IPublishedContent
Media entity, you can also use other built-in properties listed here.I am using arche type and taking image inside.
Please update on this?
Hi Manish,
Did you check this topic? https://our.umbraco.org/forum/using-umbraco-and-getting-started/85303-umbraco-76-and-media They are using Archetype as well.
is working on a reply...