Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Manish 373 posts 932 karma points
    Oct 05, 2017 @ 13:08
    Manish
    0

    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

  • Francielle 65 posts 279 karma points
    Oct 05, 2017 @ 13:24
    Francielle
    0

    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;

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Oct 10, 2017 @ 14:45
    Alex Skrypnyk
    0

    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

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Oct 05, 2017 @ 14:20
    Alex Skrypnyk
    0

    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

  • blackhawk 313 posts 1368 karma points
    Oct 10, 2017 @ 17:05
    blackhawk
    0

    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.

  • Manish 373 posts 932 karma points
    Oct 11, 2017 @ 05:57
    Manish
    0

    I am using arche type and taking image inside.

  • Manish 373 posts 932 karma points
    Oct 23, 2017 @ 10:40
    Manish
    0

    Please update on this?

  • Francielle 65 posts 279 karma points
    Oct 23, 2017 @ 10:43
    Francielle
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft