Copied to clipboard

Flag this post as spam?

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


  • Ray K. Ragan 5 posts 25 karma points
    Jul 30, 2010 @ 01:11
    Ray K. Ragan
    0

    Best practices for Images in 4.5

    Can anyone recommend some best practices for XSLT image handling in Umbraco 4.5?  I see in the new feature set for 4.5 image cropper is now an included feature, but couldn't find any use examples of it. Do we still need ImageGen in 4.5?

    Suggestions?

    Respectfully,

    Ray K. Ragan

  • Rik Helsen 670 posts 873 karma points
    Jul 30, 2010 @ 09:39
    Rik Helsen
    0

    After some digging i was able to find this datatype that supports cropping an image that is attached to a document type as a property:

    Can't find any xslt examples though... for using in page templates this should be able to do some good, but not for showing entire folders of items from the media section.

  • Ray K. Ragan 5 posts 25 karma points
    Aug 05, 2010 @ 00:08
    Ray K. Ragan
    0

    I gave the Image Cropper datatype a go, but quickly encountered an error when I tried to create content using the datatype:

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
    umbraco.editorControls.imagecropper.DataEditor.OnInit(EventArgs e) +1568
  • Arjan H. 226 posts 463 karma points c-trib
    Aug 06, 2010 @ 00:11
    Arjan H.
    2

    Did you follow these steps?

    Step 1: Create the "Image Cropper" datatype and configure crop(s):


    Step 2: Add a new property to the "Image" media type:

    Step 3: Ready to use the Image Cropper:

    And of course the XSLT example:

    <img src="{umbraco.library:GetMedia(imageID, false)//crop [@name = 'recipe_thumb']/@url}" alt="" />

    (where "imageID" is the alias of the Media Picker property)

  • Rik Helsen 670 posts 873 karma points
    Aug 06, 2010 @ 08:24
    Rik Helsen
    0

    Arjan: this functionality is not limited to media doctypes right? I hope to use this someday for images attached to page document types...

     

  • Arjan H. 226 posts 463 karma points c-trib
    Aug 06, 2010 @ 11:28
    Arjan H.
    0

    I don't think that's possible... but someone correct me if I'm wrong?

  • Daniel Bardi 927 posts 2562 karma points
    Aug 23, 2010 @ 23:08
    Daniel Bardi
    0

    It's possible... just create a new Image Cropper datatype and specify the field alias on the doctype.

    Then add a new property, using the new imgecropper datatype, to the doctype where the specified property resides.. (Media and DocTypes can both use all Datatypes)

Please Sign in or register to post replies

Write your reply to:

Draft