List inside the details page

2 posts by 2 authors in: Forums > CMS Builder
Last Post: November 2, 2012   (RSS)

Re: [justritedesign] List inside the details page

Hi Michael,

I think I can see the problem. At the top of the page you have two getRecords functions that are using the same variable to store the retrieved data. I think you just need to rename the second variable. Something like this should work:

<?php
require_once "C:/Webspace/resadmin/mmoyers/capstanag.com/www/cmsAdmin/lib/viewer_functions.php";


list($allRecords, $presentations_powerpointsMetaData) = getRecords(array(
'tableName' => 'presentations_powerpoints',
'loadUploads' => true,
'allowSearch' => false,
));

list($presentations_powerpointsRecords, $presentations_powerpointsMetaData) = getRecords(array(
'tableName' => 'presentations_powerpoints',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$presentations_powerpointsRecord = @$presentations_powerpointsRecords[0]; // get first record

// show error message if no matching record is found
if (!$presentations_powerpointsRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}

?>


<div class="text" style="padding-left:10px; padding-top:10px; padding-right:15px">
<span class="Titles">Presentations / PowerPoints: <?php echo $presentations_powerpointsRecord['title'] ?></span>
<p class="text">
<?php echo $presentations_powerpointsRecord['content'] ?><br />
<?php foreach ($presentations_powerpointsRecord['powerpoint_upload'] as $upload): ?><a href="<?php echo $upload['urlPath'] ?>"><strong>DOWNLOAD</strong></a><?php endforeach ?><p>&nbsp;</p>
</p>
<p class="SubTitles">All Presentations:
</p>
<?php foreach ($allRecords as $record): ?>
<p><span class="SubTitles"><?php echo $record['title'] ?>:</span><br />
<?php foreach ($record['powerpoint_upload'] as $upload): ?> <a href="<?php echo $upload['urlPath'] ?>">Download</a><?php endforeach ?> - <a href="<?php echo $record['_link'] ?>">More Information</a>
</p>
<?php endforeach ?>
<br /><br />
</div>


Let me know if it doesn't work

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com