The parameters
The parameters are pretty self explanatory, but let's run through them to make sure.Remember these are all done via the querystring e.g image.ashx?img=picture.jpg&w=100&h=75
- img - this is the url of your image and can be a url from anywhere on the site
- w - this is the width of the image.
- h - This is the height of the image.
Note if you're using an N2 image property that you may need to remove the ~ at the start of the url. Also, you will need to URLEncode this so that spaces etc are handled correctly. If you don't see the image appearing on your page or it appears as a broken link, it's most likely to be because the handler cannot load the image.
I have found this really helpful when automatically resizing an image depending on where it is dropped on a page. For example, if we had a standard two-column page with a small left hand column and a wider main column on the right, we'd want to size the image so that it wasn't too big - or small - for the column.
If we had a "Photograph" part, you could check which parent Zone it was in and then pass in different values to the image.ashx handler!
No comments:
Post a Comment