Copied to clipboard

Flag this post as spam?

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


  • ChristophC 21 posts 60 karma points
    Mar 22, 2016 @ 11:03
    ChristophC
    0

    Crop Images from Media Folder

    Hello!

    I have a partial view macro to display a series of images from a media folder:

    @{ var mediaId = Model.MacroParameters["mediaId"]; }
    @if (mediaId != null)
    {
    
        var media = Umbraco.Media(mediaId);
        var selection = media.Children("Image").OrderBy("SortOrder");
    
        if (selection.Any())
        {
                foreach (var item in selection)
                {
                    <div class="slide"><img src="@item.umbracoFile" alt="@item.Name" /></div>
                }
        }
    }
    

    How can I show the Images with their cropped Url?

    Thanks in advance, Christoph

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 22, 2016 @ 11:52
    Jan Skovgaard
    0

    Hi ChristophC

    You should be able to use the documentation for the image cropper here https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/image-cropper

    Hope this helps :)

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft