Hi Pete
Thanks for hanging on :).
I think you might actually be looking for something a little different than this thread is dealing with.
To me, it sounds like what you need is a list of all your staff but organized by category. To get something like that, try out this test code:
<?php $lastCategory = ''; ?>
<?php foreach ($our_staffRecords as $record): ?>
<?php if ($lastCategory != $record['category']): ?>
<h1><?php echo $record['category'] ?></h1>
<?php endif; ?>
First Name: <?php echo $record['fname'] ?><br/>
<?php $lastCategory = $record['category']; ?>
<?php endforeach; ?>
That will give you a heading for each category and then display the names of each person. You can add in more fields to display if you like or change the formatting. Basically though, the code is checking what the current category name is. If it's the same as the last one it displayed, then it just keeps going. If the current category is different from the previous one, it displays the category name.
What you'll need to do is make sure in your viewer code at the top of the page, you have
'orderBy' => 'category DESC',
You need to sort the list by the category.
Give this a shot and let me know how you make out. Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com
Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/