Copied to clipboard

Flag this post as spam?

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


  • Stephen 94 posts 255 karma points
    Jun 09, 2016 @ 13:55
    Stephen
    0

    U 7.4.x - Are all images now imageCropper images?

    Hi All,

    I am going to post this base on the assumption that my ideas of the correct answers are indeed that, please correct me if I am wrong.

    OK, so it looks to me now that all images can be controlled through the imageCropper (1st question)?

    So if I pick an image from the media section, using a media picture, I can still control the image through the imageCropper (2nd Question)?

    The obvious pitfall here is, there is no image name or banner name (@CurrentPage.GetCropUrl("image", "banner")). So I can find references to using the usual command. From further research I have found this:

    var image = Umbraco.TypedMedia(mediaID); image.GetCropUrl();

    Which is great, BUT, many code snippets I use are Dynamic, and this doesn't work if it is dynamic. Can some one tell me how to do this dynamically please? i.e.:

    var image = Umbraco.Media(mediaID); image.GetCropUrl();

    Thanks

    Stephen

  • MarcC 49 posts 356 karma points
    Jun 09, 2016 @ 14:16
    MarcC
    0

    Hey Stephen,

    Q1. Yes all media items now have the Image Cropper property type by default.

    Q2.Yup, as long as you are getting the crop url

    You create the crops for example "banner" in the Image cropper data type, this sets the resolution of the image and you can adjust the focal point. Not sure if you know this, if not could you give me an example of what you mean by doing it dynamically please?

    You are retrieving the media item via the library rather than say a media picker property?

    atb,

    M

  • Stephen 94 posts 255 karma points
    Jun 09, 2016 @ 15:05
    Stephen
    0

    Hi Marc,

    Thanks for your reply.

    So I am not talking about this at a user level, more a code level.

    I am aware of creating the crops with names etc, but this is not something I am needing to do thanks.

    What I specifically mean is:

    A image is uploaded to the site via the media section (it's a standard image, nothing special). I pick said image using the media picker.

    Now in my code I can access the image WITHOUT the name/crops etc using strongly typed code, but I want to know how to do this using a dynamic syntax please.

    so using CurrentPage.... instead of Model.Content....

    Thanks

    Stephen

  • Stephen 94 posts 255 karma points
    Jun 13, 2016 @ 09:28
    Stephen
    0

    Hi All,

    I am assuming as no one has answered that means there is no way to do this dynamically?

    Thanks

    Stephen

Please Sign in or register to post replies

Write your reply to:

Draft