Re: [dsternalski] Navigation
Hi,
I noticed a couple of things looking at your code. In your screen shot you have 6 categories (Home, Client Enquiry, Current Vacancies, Register with us, About Us, and Contact Us). Some of these have been hard coded (ie,Current Vacancies) and the others are populated with foreach loops. I'm assuming that Current Vacancies don't have any "second navigation".
I also noticed that Client Enquiry and About Us are selected using getCategories while Register With Us and Contact Us are selected using getRecords. Is there a reason for this difference?
If your foreach loops are only being used to output your second navigation, I would suggest hard coding all 6 of your top level navigation. Then put an if statement around each foreach loop IF $thisPage relates to that category. For example:
<li><a href="aboutUs.php">About Us</a></li>
<?php if($thisPage =="aboutUs"):?>
<?php foreach ($allAbout_usRecords as $categoryRecord): ?>
<?php if(!$categoryRecord['right_features']) : ?>
<?php echo $categoryRecord['_listItemStart']; ?>
<?php if($thisPage == "aboutUs"): ?>
<span class="active"><a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a></span>
<?php else: ?>
<a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a>
<?php endif ?>
<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endif ?>
<?php endforeach; ?>
<?php endif ?>
You can then remove the top navigation record from your sections and only have the second level navigation outputted when that page is selected.
Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/