Home | Products | Consulting | Hosting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Little Help with Images

 

 


dparrott
Novice

May 9, 2008, 3:08 PM

Post #1 of 8 (467 views)
Shortcut
Little Help with Images Can't Post

Hello, I'm needing a little help with images.
I'm trying to understand how they work. Here is my understanding (which may be totally off base):
To have images on my site I upload them, both a smaller thumbnail and larger image of the same.
If that is the case how do I get it so that on the detail (or single item page) the user can click on the thumbnail to see the larger image?
Can this work with multiple images on the same detail page?

thanks
dale


Dave
Staff / Moderator


May 9, 2008, 7:43 PM

Post #2 of 8 (458 views)
Shortcut
Re: [dparrott] Little Help with Images [In reply to] Can't Post

Dale, welcome to the forum, we're here to help! :)

You can upload images through either a wysiwyg field or an upload field. And the program will automatically resize it (if it's oversized) and create a thumbnail as well. So you only need to upload an image once. You can control the resizing and thumbnailing options for each field in the field editor.

To link a thumbnail to a large image in the wysiwyg you'd do as follows: You'd click the image button (looks like a tree), then the browse button beside "image url" and upload your image. Then click "small" to insert a small version. Then click on the image in the wysiwyg and click the link button. Click browse beside "Link Url" and you'll see your upload, then click "large" to insert a link to the large version.

If you're using an upload field and you want images displayed automatically you'd do as follows (this is for the latest version 1.15, but earlier version are similar):


Code
<?php foreach ($newsRecord['uploads'] as $upload): ?> 

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

<?php endforeach ?>


Note that you're record variable may be named something other than "newsRecord", just use whatever name is already in the code. The $upload part is usually the same. Basically there's a list of available fields: urlPath, height, width, thumbUrlPath, thumbWidth, thumbHeight, etc and you can display any of them with a tag like this: <?php echo $upload['thumbHeight'] ?>. So we display the url of the big image 'urlPath' in the a href tag and the url to the thumbnail 'thumbUrlPath' in the image tag.

You should be able to do most of that by just moving around the code generated by the code generator.

Hope that helps. Let me know if you need any more detail on any of that. :)

Dave Edis - Senior Developer
interactivetools.com


dparrott
Novice

May 12, 2008, 10:30 AM

Post #3 of 8 (237 views)
Shortcut
Re: [Dave] Little Help with Images [In reply to] Can't Post

That did the trick Dave thank you very much. Is there a way I can get multiple thumbnail images to display in a row rather than one above the other?


dparrott
Novice

May 12, 2008, 12:31 PM

Post #4 of 8 (223 views)
Shortcut
Re: [dparrott] Little Help with Images [In reply to] Can't Post

Nevermind Dave. I found an offending <br> in there... sorry.
thanks for the help


Dave
Staff / Moderator


May 12, 2008, 1:22 PM

Post #5 of 8 (215 views)
Shortcut
Re: [dparrott] Little Help with Images [In reply to] Can't Post

I just about to post too, but you beat me to it. Glad you figured it out! :)

Dave Edis - Senior Developer
interactivetools.com


dparrott
Novice

May 12, 2008, 2:01 PM

Post #6 of 8 (209 views)
Shortcut
Re: [Dave] Little Help with Images [In reply to] Can't Post

Things are going pretty well Dave, but I need a little help with the images on my List page. The page currently pulls in all thumbnails for a product and I want it only to pull one in. Here is the code that I have

Quote
<?php // foreach (getUploads($options['tableName'], 'images', $record['num']) as $upload): ?>
<?php $upload = getUploads($options['tableName'], 'images', $record['num']); ?>
<a href="<?php echo $record['_link'] ?>">
<img src="<?php echo $upload['thumbUrlPath'] ?>"
width="<?php echo $upload['thumbWidth'] ?>"
height="<?php echo $upload['thumbHeight'] ?>"
alt="" /></a>

<?php // endforeach ?>


I took the foreach statement out, but that didnt' seem to help.

does this make sense?

thanks
dale


Dave
Staff / Moderator


May 12, 2008, 2:16 PM

Post #7 of 8 (208 views)
Shortcut
Re: [dparrott] Little Help with Images [In reply to] Can't Post

Using the foreach just add this tag before the "endforeach", like this:


Code
  <?php break; ?> 
<?php endforeach; ?>


"break" just means "stop looping over images". That should show 1 and then stop.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com


dparrott
Novice

May 12, 2008, 2:19 PM

Post #8 of 8 (207 views)
Shortcut
Re: [Dave] Little Help with Images [In reply to] Can't Post

Thanks Dave.
You Rule!

dale

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Hosting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4