Re: [Dave] Displaying list view in columns
Hi Dave,
I have used this two column script before and it worked great so I don't know why it's fighting me so badly now. If you can tell me what I'm doing wrong I would really appreciate it!
This is the code I'm using and it's working - except for the fact that it only lists one physician name under each category then shoots the extras to the top of the page. I have my pre-column version at the bottom of the page. I have really tried working this out and I hope I'm not missing something really obvious.
list($specialtiesRecords, $selectedCategory) = getCategories(array(
'tableName' => 'specialties',
));
// load records
list($physicians_wyomingRecords, $physicians_wyomingMetaData) = getRecords(array(
'tableName' => 'physicians_wyoming',
));
// organize physician records into specialties
$physicianSpecialityToRecord = array();
foreach( $physicians_wyomingRecords as $physician) {
// break selected specailties into an array
$specialties = explode("\t", trim($physician['specialties'], "\t"));
foreach ($specialties as $specialty){
$physicianSpecialityToRecord[$specialty][] = $physician;
}
}
and then the display code________________________
<table width="635" border="0">
<tr>
<?php foreach ($specialtiesRecords as $categoryRecord): ?>
<td>
<?php echo $categoryRecord['_listItemStart'] ?>
<?php if ($categoryRecord['_isSelected']): ?><b><?php endif ?>
<a href="?category=<?php echo $categoryRecord['num'] ?>"><?php echo $categoryRecord['name'] ?></a>
<?php if ($categoryRecord['_isSelected']): ?></b><?php endif ?>
<?php echo $categoryRecord['_listItemEnd'] ?>
<?php foreach ($physicianSpecialityToRecord[$categoryRecord['num']] as $physician): ?>
<a href="<?php echo $physician['_link'] ?>"><?php echo $physician['physician_first_name'] ?> <?php echo $physician['title'] ?></a>
</td>
<?php $maxCols=2; if (@++$count % $maxCols == 0): ?></tr><tr>
<?php endif; ?>
<?php endforeach ?>
<?php endforeach ?>
</tr>
</table>
http://www.nwsc5872139.myutilitydomain.com/physiciansList.php
_____________________________
I was also hoping to have the physician names bulleted (custom bullets or text bullets) other than having the category names... but I'm not sure where to even start with that.
_____________________________
Also, is it possible to direct the category links to the pages that are already setup for that category? For instance, when I click on Orthopedic, it goes to:
myutilitydomain.com/physiciansList.php?category=4
and I would prefer for it to go to:
myutilitydomain.com/orthopedic.php
Thanks so much for your help! Tina