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?
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.
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
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)
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
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.
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:
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)
Arjan: this functionality is not limited to media doctypes right? I hope to use this someday for images attached to page document types...
I don't think that's possible... but someone correct me if I'm wrong?
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)
is working on a reply...