Add thumbnail with each title displayed

5 posts by 2 authors in: Forums > CMS Builder
Last Post: February 24, 2010   (RSS)

Re: [invisions] Add thumbnail with each title displayed

By gkornbluth - February 24, 2010 - edited: February 24, 2010

Hi Daniel,

Unless I'm missing something (altogether possible), you should be able to display (thumbnail) images by adding this to your code after the link and before the <hr><?php foreach ($record['your_image_upload_field'] as $upload): ?>

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

<?php endforeach ?>


If your question is about formatting, here's an excerpt from my CMSB Cookbook www.thecmsbcookbook.com that sets up a 2 column table with a linked image.

<table width="90%" border="0" cellpadding="5"><?php foreach ($environmental_analysisRecords as $record): ?>
<tr>
<td align="center">&nbsp;</td>
<td align="left" valign="top"><hr align="left" width="300" color="#99945e"/></td>
</tr>
<tr>
<td align="center">

<?php foreach ($record['your_image_upload_field'] as $upload): ?><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; ?>

</td><td align="left" valign="top"><a href="<?php echo $record['_link'] ?>"><span class="heading-text-bold"><?php echo $record['title'] ?></span>
</a><?php endforeach; ?> </td>
</tr>
</table>


Don't forget to change the your_image_upload_field and the styling to your values.

Hope that helps,

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: [gkornbluth] Add thumbnail with each title displayed

Hey Jerry,
Thank you very much for your post and your help.

With the code you provided, how do I choose which thumbnail image to use for each title listed? Do I do this in the admin panel, and if so, where in the admin panel do I choose a thumbnail image for each article/title?

Thank you again.
Daniel Pegues
invisionshosting.com

Re: [invisions] Add thumbnail with each title displayed

By gkornbluth - February 24, 2010 - edited: February 24, 2010

If I'm understanding you correctly, you should have created an upload field in your environmental_analysis section editor. Limit the amount of uploads to "1" and the file types to jpg,gif,png . (I usually call my field list_page_image if it's to be a distinctly unique list page image)

For each record, you'd upload a unique list page image for that record.

Then the thumbnail that displays next to a particular "title" is the one you uploaded.

Best,

Jerry
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: [gkornbluth] Add thumbnail with each title displayed

Thank you so much again for your help Jerry. It is late where I am right now, so I am gonna get to this first thing in the morning. I will write tomorrow and let you know how it goes.

Thanks again!!!!
Daniel Pegues
invisionshosting.com