Re: [dsternalski] Contact form/navigation
Hi dsternalski,
I think your IF...ELSEIF strategy in navigation.php is causing the problems. For example, if you have two records at depth==1, your code is going to generate an extra </li>, which will break your page layout.
There is a much simpler way. First, replace the getRecords() calls for your Category Menus with getCategories() calls:
list($allGalleryRecords,) = getCategories(array(
'tableName' => 'gallery',
));
list($allLinksRecords,) = getCategories(array(
'tableName' => 'links',
));
Next, replace your foreach's with these foreach's:
<?php foreach ($allGalleryRecords as $categoryRecord): ?>
<?php echo $categoryRecord['_listItemStart'] ?>
<a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['navigation_name'] ?></a>
<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endforeach; ?>
<?php foreach ($allLinksRecords as $categoryRecord): ?>
<?php echo $categoryRecord['_listItemStart'] ?>
<a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['navigation_name'] ?></a>
<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endforeach; ?>
The _listItemStart and _listItemEnd will take care of adding <ul> and </ul> tags where they're needed depending on the depth of the records displayed.
I hope this helps! Please let us know if you have any more questions.
All the best,
Chris