Copied to clipboard

Flag this post as spam?

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


  • Rasmus Thyssen 14 posts 63 karma points
    Dec 09, 2014 @ 09:40
    Rasmus Thyssen
    0

    Unable to get the cropped images from media folder - Razor, Umbraco 6.1.6

    Hi all.

    I have a macro where i want to show a gallery of cropped images but i cant get to the cropped image. :(

    1. I have created a "image cropper extended" Data Type with 2 "Crops" called "rectangle & square".
    2. I've added a new property to my media images, with the alias "imageCropper".
    3. Then i added some images to a folder in my media archive and made a crop of those images.
    4. Now im trying to loop throug the images in Razor to make a gallery list - I get all the data on the image, except the cropping data.
    I have stripped the code, so that you guys can see which part is not working. This is what im doing:
    @using idseefeld.de.imagecropper.PropertyEditorValueConverter;
    @inherits umbraco.MacroEngines.DynamicNodeContext
    @{
    var galleryFolder = Model.MediaById(Parameter.imageFolder);
    }
    <div class="gallery">

    @foreach (var galleryImage in galleryFolder.Children.Where("NodeTypeAlias == \"Image\""))
    {
    <div>
    @galleryImage.imageCropper.Find("square").url
    </div>
    }
    </div>

    Best regards Rasmus

     

  • Sören Deger 733 posts 2844 karma points c-trib
    Dec 09, 2014 @ 09:50
  • Rasmus Thyssen 14 posts 63 karma points
    Dec 09, 2014 @ 09:57
    Rasmus Thyssen
    0

    Thanks Sören. That worked :)

  • Simon 692 posts 1068 karma points
    Feb 17, 2015 @ 22:56
    Simon
    0

    Hi, 

    I would like to know if it is possible to have an image and crop in way that the width is 100% because I want the image as a cover photo on each page.

    Therefore, I would like to set the crop with width 100% and height 563px for example.

    Is is possible pls?

    Thank you in advance.

    Regards 

Please Sign in or register to post replies

Write your reply to:

Draft