Copied to clipboard

Flag this post as spam?

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


  • Jin Botol 134 posts 287 karma points
    May 26, 2017 @ 05:58
    Jin Botol
    0

    Create Multiple Image Cropper

    Hi,

    How can I clean this in my back office. I have 10x of Image Gallery but the same in alias. enter image description here Is is possible to make it only one and upload 10 of image gallery using image cropper datatypes?

    I'm new in Umbraco developer, hope someone will guide on this bug :)

    Regards,

    Jin

  • Brett Fullam 119 posts 629 karma points
    May 28, 2017 @ 02:51
    Brett Fullam
    0

    Hi Jin,

    I'm relatively new to Umbraco myself, but I recently learned a few new techniques-tactics here in the forum and on umbraco.tv that have helped me tremendously.

    To answer your question, you CAN create a single image cropper that will allow you to upload multiple images. The image cropper page in the Documenation section of this site has a block of code labeled "Dynamic" which can be used in a "foreach" loop to give you the functionality you're looking for ... essentially 1 instance in the Back Office that will allow you upload multiple images into the same group. Here's a link to the Documentation page:

    https://our.umbraco.org/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Image-Cropper

    The other item that was a total game changer for me was the "Archetype" package add-on. It creates blocks of readily repeatable content based on whatever groups of property editors you'd like to put together ... definitely check it out. Here's a link to the package documentation: https://our.umbraco.org/projects/backoffice-extensions/archetype/

    The last solid tip I'll drop on you is the "compositions" feature in the document types section. This will allow you to add property types from other document types ... for instance, you can create a single document type without a template that has a property type you'd like to include on some of the pages of your site, but not all of them. When you click "compositions" you can pick and choose what other document type properties to add to your current doctype. This is especially powerful when you combine it with Archetype.

    Good luck with your media cropper ... keep me posted on your progress.

  • Jin Botol 134 posts 287 karma points
    May 29, 2017 @ 09:37
    Jin Botol
    0

    Hi Brett,

    I'm done creating one image cropper and allow to upload multiple images. My problem is I want to get it from the surface controller and I don't know how to do it.

    Hope you can help me with this.

    Jin

  • Jin Botol 134 posts 287 karma points
    May 30, 2017 @ 06:38
    Jin Botol
    0

    Hi,

    This is what I did in the surface controller. My problem is how to get image copper

    var caseStudyImagesList = Umbraco.TypedContent(Convert.ToInt32(document.Get("id"))).GetPropertyValue<string>("images").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse);
    var caseStudyImagesCollection = Umbraco.TypedMedia(caseStudyImagesList).Where(x => x != null);
    
    var product = new Product()
    {
         //put here
    };
    

    I'm stuck with this.

    Jin

  • Jin Botol 134 posts 287 karma points
    May 31, 2017 @ 09:57
    Jin Botol
    0

    Hi All,

    What I did is

    enter image description here

    Hope some will help me about this error.

    Jin

  • Jin Botol 134 posts 287 karma points
    Jun 01, 2017 @ 03:00
    Jin Botol
    0

    Hi Jeavon, All,

    I tried this code but it fails again.

    docsId.GetPropertyValue<string>("images").GetCropUrl(width: 329, height: 200)
    

    but it say's

    Cannnot implicitly convert type 'string' to 'System.Collections.Generic.List<string>

    Hope someone will help me. I'm stuck

    Jin

Please Sign in or register to post replies

Write your reply to:

Draft