Add thumbnail with each title displayed

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

Hello.
I need to add a unique thumbnail picture with each title listed on my page. Here is a reference of what I am trying to do: http://www.cloughharbour.com/go/project

And, I am currently using the following code to list the titles:


<div id="fp_list_placement">
<?php foreach ($environmental_analysisRecords as $record): ?>
<a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a>
<br/>
<hr/>
<?php endforeach ?>
</div>


I appreciate the help.

Thanks.
Daniel Pegues
invisionshosting.com

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: [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