Ii Chris,
The plugin has been working perfectly on my detail pages but this is the first time that I've tried to use it on a list page.
On the list page, using the code below, it pulls the venue_name etc., from all the related field records into each event record. (The lookup for the detail page in this set works as expected.)
I know that the inner foreach loop is the culprit, and that I must be missing something simple (as always) but I’m not having any luck figuring it out.
The lookup is from a single value list field.
Thanks,
Jerry Kornbluth
Here’s the code at the head of the list page:
list($e_blast_events_noticeRecords, $e_blast_events_noticeMetaData) = getRecords(array(
'tableName' => 'e_blast_events_notice',
));
beta_lookupRelatedFields(array(
'table' => 'e_blast_events_notice',
'recordList' => &$e_blast_events_noticeRecords,
'fieldList' => array( 'venue' )
));
$e_blast_events_noticeRecord = @$e_blast_events_noticeRecords[0]; // get first record
And here’s the code I;m using to display the information
<?php foreach ($e_blast_events_noticeRecords as $record): ?>
<?php if ($record['event_title']): ?><br /><br />
<?php foreach ($e_blast_events_noticeRecords as $record): ?>
<?php $venue = $record['venue']; ?>
Location:</span><br />
<?php echo $venue['venue_name']; ?><br />
<?php echo $venue['venue_address'] ?><br />
<?php endforeach; ?>
<?php endforeach; ?>
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