I have created a list of categories and inserted it into a list of documents/links.
So my loading code looks like this:
// load records from 'resource_links_docs'
list($resource_links_docsRecords, $resource_links_docsMetaData) = getRecords(array(
'tableName' => 'resource_links_docs',
'loadUploads' => true,
'allowSearch' => false,
));
So I want to layout the doc/link lists by category:
First Category
Doc
Link
Link
Doc
Etc...
Second Category
Doc
Doc
Link
Doc
Etc...
And So on
So I have these variables:
<?php echo htmlencode($record['title']) ?>
<?php echo join(', ', $record['category:values']); ?>
<?php echo join(', ', $record['category:labels']); ?>
<?php echo htmlencode($record['link']) ?>
<?php foreach ($record['document'] as $index => $upload): ?>
<?php echo htmlencode($upload['urlPath']) ?>
<?php endforeach ?>
And would like to set it up like this:
<foreach...>
<h4><category:labels></h4>
<if upload then...>
<?php foreach ($record['document'] as $index => $upload): ?>
<a href="<?php echo htmlencode($upload['urlPath']) ?>"><p><?php echo htmlencode($upload['filename']) ?></p></a>
<?php endforeach ?>
<else>
<a href="<?php echo htmlencode($record['link']) ?>" target="_blank"><p><?php echo htmlencode($record['title']) ?></p></a>
<?php endforeach ?>
So I know this has been done by me before but I can not remember and can not seem to find the correct example to work off of.
Thanks for your help with this.
Michael
Michael Moyers
Owner of Just Rite Design Inc. A growing network of professionals in web design, graphic design, flash development, programming, and audio & video productions.
"Due to budget constraints, the Light at the end of the tunnel will be temporarily out!"