Copied to clipboard

Flag this post as spam?

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


  • Matthew 138 posts 199 karma points
    Apr 25, 2014 @ 02:37
    Matthew
    0

    use full image of cropper instead of crop, but typed, not dynamic

    In some cases, it would be useful to use an image cropper image w/o any crops. In the cropper docs, this example works:

    <img src='@CurrentPage.image.src'/>
    

    In my case, I'm trying to use this in a foreach loop, so @CurrentPage is not the node I want. I've tried a bunch of different ways and although I get the basic structure (focal point, src, crops), I've been unable to use it with '.src', like:

    <img src='@SomethingBesidesCurrentPage.SomeVar.src' />
    

    it never knows what 'src' is. Trying a variation on @Umbraco.Field("myImageCropper").src, it throws the error:

    'System.Web.IHtmlString' does not contain a definition for 'src' and no extension method 'src' accepting a first argument of type 'System.Web.IHtmlString' could be found (are you missing a using directive or an assembly reference?)

    Is there a using I should be using? Some other fairy dust?

  • Matthew 138 posts 199 karma points
    Apr 25, 2014 @ 05:15
    Matthew
    0

    OTOH, one could make a super large 'crop' and use that like a crop, which makes sense but is not very gratifying...

    Still like to know why 'src' doesn't work with typed media. Or rather, that I can't get it to work...

    Thanks.

  • Jeavon Leopold 3008 posts 13221 karma points MVP 7x admin c-trib
    Apr 25, 2014 @ 08:01
    Jeavon Leopold
    0

    Hi Matthew,

    Could you please post your full code to show how you are looping to set your variable.

    Jeavon

  • 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