Being a heavy user of Dynamicweb CMS I am very happy to discover that the latest version of the software has made the utility for cropping/scaling images work as I (IMHO) always have wished it to do! It is now possibel to specify both with and height and having the image fit inside the area keeping the aspect ratio of the image! Hurra!
You do know getimage.aspx, right?
When you have a design to implement using Dynamicweb CMS and you have a list of items with images – say thumb images, Dynamicweb offers a nice utility which can ensure that the thumbs will have a given dimension. The images are cached on the server, so it is not using unnessesary resources of the server if you use the utility.
The utility can be found on any Dynamicweb soloution here:
http://[hostname]/Admin/Public/getImage.aspx
Enter the URL above and you will get a nice wizard which will dynamically produce what you need inside your templates. You can see the wizard above.
What makes things work for my needs!
To ensure that an image fits inside a container with known dimentions you need to:
- Enter the dimensions (width/height)
- Select the cropping offset: “Keep aspect ratio”
Try the utility by entering a path to an image – you have to start from “/files…”. When that is done, simply press OK and you will get a preview under the “Results” tab, as you can see below.
Using the Image URL in your templates
When you are happy with the results you should copy the “Image URL” path (highlighed with blue in the above image). The URL for my example is:
/admin/public/getimage.aspx?Image=/files/billeder/300×80.jpg&Format=jpg&Width=200&Height=100&Crop=5
If I were to use this path inside a template, I simply would replace the “/files/billeder/300×80.jpg” with a template tag like “<!--@Ecom:Product.ImageLarge.Clean—->”.
I hope this has helped you! I really find this improvement nice!
links
- Dynamicweb Templates
- Finally webdav access to dynamicweb websites
- (en-US) Release Notes, Dynamicweb 7.1.pdf
The other day I wrote a post about