Create thumbnails from larger image

3 posts by 3 authors in: Forums > CMS Builder
Last Post: July 13, 2010   (RSS)

Re: [degreesnorth] Create thumbnails from larger image

By gkornbluth - July 13, 2010

Hi Degreesnorth,

I'm not sure that I understand your issue. Are you saying that the image is in a single record editor and not a multi record editor?

Usually, when you set up your upload field, thumbnails are (or can be) automatically created for each image. The size of these can be changed and recreated in the image validation area of the upload field editor for that image upload field.

In a multi record editor situation, a list page showing all the thumbnails is easily created using the code that is generated by the code generator for that table.

The style of that thumbnail display can easily be modified to suite your needs. There are many styling recipes in my CMSB Cookbook http://www.thecmsbcookbook.com that should help.

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [degreesnorth] Create thumbnails from larger image

By Jason - July 13, 2010

Hi,

Yes, it is possible in CMS Builder to have up to 4 thumbnails of different sizes for any given image. You can also get these without having to manually resize or reupload.

Go to the section you want to work with. At the bottom of the page, select "Admin: Edit Section". This will give you a list of all the different fields you have in that section. Find "property_image_right" and click on the modify link beside it. This will pop up a window.

Look at the details for the "Input Validation" Section. Here it allows you to select up to 4 different thumbnails. Click the checkbox for each of the different thumbnails you want to create. You can change the values for height and width to whatever you want (note that the resized images will keep their proportions. The values you enter here will just be the maximum values). After you're done selecting each thumbnail you want, you can click the "recreate" button. This will go through all of the images previously uploaded and create a thumbnail of the proportions you entered.

Once you're done, click on Save. Note that you only have to do this once. After that, these thumbnails will automatically be created for any new image uploaded.

In your code, you can access these thumbnails using the following fields:

thumbnail 1 fields:

[thumbFilePath]
[thumbUrlPath]
[thumbWidth]
[thumbHeight]

thumbnail 2 fields

[thumbFilePath2]
[thumbUrlPath2]
[thumbWidth2]
[thumbHeight2]

thumbnail 3 fields

[thumbFilePath3]
[thumbUrlPath3]
[thumbWidth3]
[thumbHeight3]

thumbnail 4 fields

[thumbFilePath4]
[thumbUrlPath4]
[thumbWidth4]
[thumbHeight4]


Let me know if you run into any issues.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/