Copied to clipboard

Flag this post as spam?

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


  • blackhawk 313 posts 1368 karma points
    Mar 21, 2017 @ 20:54
    blackhawk
    0

    Media Picker for Umbraco 7.6.0-beta

    Testing out Umbraco 7.6.0-beta...

    • I created a document type and template.
    • On my document type, I added the media picker
    • On the associated template, I added

      <umbraco:item field="featuredImage" runat="server" />
      
    • I then created a content page to associate to my template file. While editing the page, I can easily upload an image and see a preview of it.

    • The page published fine but when I preview the page, I get the following line in place of the media item....

      umb://media/89c8c0b3c94d4f5da7c5bcce989f9c59
      

    What do I do with this? I was expecting an image path...

    Thanks

  • blackhawk 313 posts 1368 karma points
    Mar 22, 2017 @ 16:32
    blackhawk
    100

    I was able to backtrack my issue, and researched on how to properly add the media picker to an image element from my MVC template location. The following code allows me to see my media picker asset.

      <img src="@Umbraco.Media(@CurrentPage.featuredMediaPickerImage).Url" alt="">
    

    featuredMediaPickerImage is simply the alias of the media picker which I attached to my template.

Please Sign in or register to post replies

Write your reply to:

Draft