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

Home: Products: CMS Builder:
Handling image uploads

 

 


macwebster
New User

Nov 14, 2008, 2:31 PM

Post #1 of 2 (416 views)
Shortcut
Handling image uploads Can't Post

Can you explain how I reference the full size image versus the thumbnail?

I would like the thumbnail image to be clickable to the full size image. DO I have to make this link manually or is there an automatic way to do it?

I see the full size image in the cmsAdmin/uploads/ directory but I do not see it appear on my php pages.

I am making a Staff page and the list page shows the thumbnail perfectly on the staff list, but there is no sign of the full size image on the detail page.

Thank you in advance, Julia


Dave
Staff / Moderator


Nov 14, 2008, 4:12 PM

Post #2 of 2 (412 views)
Shortcut
Re: [macwebster] Handling image uploads [In reply to] Can't Post

Hi Julia,

The Code Generator should generate image tags for both. Usually it looks something like this:

I've highlighted the important parts in red.


Code
      <!-- STEP 2a: Display Uploads for field 'uploads' (Paste this anywhere inside STEP2 to display uploads) --> 
<?php foreach ($newsRecord['uploads'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>

<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

<?php endif ?>
<?php endforeach ?>
<!-- STEP2a: /Display Uploads -->


What this code does is display the thumbnail if it's available, or if not then the full size image, or if that's not available then a link to the file (since it's probably a PDF or something). So we take the thumbnail image tag and link it to the full size image url like this:


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


Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
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