thumbnail image to larger image

6 posts by 4 authors in: Forums > CMS Builder
Last Post: January 18, 2011   (RSS)

Re: [Oakweb] thumbnail image to larger image

Hi Oakweb,

Yes there is.

There are 4 thumbnails that can automatically be set up when you upload an image.

Go to your section editor entry in the admin area and click on modify, then on modify next to your upload field, and then on
"input validation"

You'll see 4 thumbnails that you can set to different sizes to meet your different page requirements.

After you've set the thumbnail 2 to the size that you want it for your larger detail page image (DONT FORGET TO check the box next to thumbnail 2) , click on "recreate". After the new thumbnails are created click "Save".

In your detail viewer, instead of thumbUrlPath, thumbWidth, and thumbHeight

substitute

thumbUrlPath2, thumbWidth2, and thumbHeight2

You'll find lots more information on how CMS Builder works in my CMSB Cookbook http://www.thecmsbcookbook.com

Hope that solves your mystery.

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: [Oakweb] thumbnail image to larger image

By Jason - November 4, 2010

Hi,

Jerry has a good suggestion here for creating/recreating the thumbnails.

You can also choose to use the fullsize image (not the thumbnail) as well if you like.

You're code to output the thumbnail probably looks something like this:

<img src="<?php echo $upload['thumbUrlPath'];?>" height = "<?php echo $upload['thumbHeight'];?>" width="<?php echo $upload['thumbWidth'];?>" alt="" />

To output the original uploaded image, change the code to this:

<img src="<?php echo $upload['urlPath'];?>" height = "<?php echo $upload['height'];?>" width="<?php echo $upload['width'];?>" alt="" />

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/

Re: [Jason] thumbnail image to larger image

By Oakweb - November 5, 2010

Thank you all very much - all sorted.

Re: [Oakweb] thumbnail image to larger image

By Rusty - January 18, 2011 - edited: January 18, 2011

Why do I have to hit recreate? That's a bit tedious.

I initially added a second thumb to be created when I created the section editor.

Do I have to hit recreate every single time the upload changes, or just the first time that I'm adding the additional thumb?

Also shouldn't CMSBuilder check to see if Thumbs2 is checked, and if so display that in the Code Generator?

Having to know that I need to write thumbUrlPath2 and all that is tedious is well (as opposed to copying and pasting)
Rusty

Re: [Rusty] thumbnail image to larger image

By Jason - January 18, 2011

Hi Rusty,

You just need to hit recreate when you change the dimensions of your thumbnails or you add a new thumbnail. This is because CMS Builder does the resize when you upload, so if you change the dimensions of your thumbnail, the images you've already created need to be resized. This isn't done automatically since some users may want to only resize future thumbnails, not images already uploaded.

Since you can have up to 4 different thumbnails for an upload field, the code generator doesn't know which one you would want to use, so it defaults to the first thumbnail.

If you like, our consulting service could write some custom code for you to output the second thumbnail if checked. Please let us know if this is something you're interested in.

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/