Copied to clipboard

Flag this post as spam?

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


  • Brian Milman-Hurst 48 posts 76 karma points
    Feb 05, 2013 @ 11:25
    Brian Milman-Hurst
    0

    Amended cshtml files to reference user uploaded image

    Hi guys,

     

    I hope you can help me.  I am currently incporating the uBlogsy platform into a website that encompasses standard Umbraco pages along with a Foum and the blog platform, but I need some assistance with referencing user uploaded images within the uBlogsyHomeShowPost.cshtml file.

    I have amended the showlists file so that key articles will appear on the home page and along with that I have also amended the Blog Post template and document types to include an image that will be used both within the post itself and as a teaser image on the home page.

    I have been able to easily resolve the style and placement issues of all the requried text but I cannot see how to reference the image (alias of featuredImage) within the cshtml file.

    Any thoughts guys!!??

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Mar 12, 2013 @ 12:35
    Anthony Dang
    0

    I assume the image appears in the umbraco media library:

    var id = theNodeYouAreRendering.GetPropertyValue("featuredImage");

    var m = new Media(id);

    now in your img markup youneed src="m.Url"

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies