Copied to clipboard

Flag this post as spam?

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


  • Kim Bantz Rasmussen 81 posts 310 karma points
    Apr 08, 2013 @ 11:52
    Kim Bantz Rasmussen
    0

    Umbraco 6 - Media picker and crops

    Hi!

    @if(@slide.HasValue("slideImage")){
    
        var mediaItem = Umbraco.TypedMedia(@slide.GetPropertyValue("slideImage")); 
        <img src="@mediaItem.GetPropertyValue("umbracoFile")" alt="@mediaItem.GetPropertyValue("Name")"/>    
    
    } 

    The code above works great, and in Umbraco 4.11 I could get a crop by using .Replace, but this is not working:

    <img src="@(mediaItem.Url.Replace("." + mediaItem.Type, "_person." + mediaItem.Type))" alt="@mediaItem.Name" />
    
    Any clues?
    Error: CS1061: 'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'Type' and no extension method 'Type' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
    Best regards
    Kim

  • 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