I currently output a simplistic list summary using this code.
<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
require_once "/system/lib/viewer_functions.php";
$orderBy = @$_REQUEST['orderBy'];
$orderByClean = "";
if(!$orderByClean) { $orderByClean = 'ufbb_cheap_total_price+0'; }
list($isp_listRecords, $isp_listMetaData) = getRecords(array(
'tableName' => 'isp_list',
'limit' => '5',
'loadCreatedBy' => false,
'where' => " category LIKE '%Ultrafast Broadband%' ",
'orderBy' => $orderByClean,
));
?>
<ul class="g_ulbox">
<?php foreach ($isp_listRecords as $record): ?>
<li style="padding-bottom:3px;"><a href="//www.DOMAIN.com/Detail_Output.php?<?php echo preg_replace("/[ ]/", "-", $record['title']); ?>-<?php echo $record['num'] ?>" title="<?php echo $record['title'] ?>"><?php echo $record['title'] ?></a> £<?php echo $record['ufbb_cheap_total_price'] ?><br />Speed: <?php echo $record['ufbb_cheap_download_average_speed'] ?>, <?php echo $record['ufbb_cheap_usage'] ?><br />Gift: <?php echo $record['ufbb_cheap_voucher_or_gift_credit'] ?></li>
<?php endforeach ?>
</ul>
<?php if (!$isp_listRecords): ?>
<br /><br /><b><u>No records were found!</u></b><br/><br/>
<?php endif ?>
Now what I want to be able to do is add the product image to that output, while also displaying a default image if the product doesn't yet have an image uploaded. I can already do this by inserting the following code on an individual product output page using this code:
<?php foreach ($isp_listRecord['logo_image'] as $upload): ?>
<div class="vanishmobile"><a href="<?php echo $isp_listRecord['website_link'] ?>" target="_new"><img src="<?php echo $upload['urlPath'] ?>" alt="<?php echo $isp_listRecord['title'] ?> Logo Image" title="<?php echo $isp_listRecord['title'] ?> Logo Image" /></a></div>
<?php endforeach ?>
<?php if (!$isp_listRecord['logo_image']) : ?>
<div class="vanishmobile"><a href="<?php echo $isp_listRecord['website_link'] ?>" target="_new"><img src="//www.DOMAIN.COM/noImageProduct.jpg" alt="Default Logo Image" title="Default Logo Image" /></a></div>
<?php endif ?>
So ideally I need to get something similar working in the list output too, but I'm not sure quite how to do it?