Navigation

12 posts by 3 authors in: Forums > CMS Builder
Last Post: January 14, 2011   (RSS)

Re: [dsternalski] Navigation

By Chris - November 15, 2010

Hi dsternalski,

I'm thinking this is probably a CSS issue. Can you provide a URL to a page which shows the problem?
All the best,
Chris

Re: [chris] Navigation

By dsternalski - November 16, 2010

Hi,

The main navigation problem is a css one, but the problem that I am refereing to is the second nav (where it says test under the main nav).

Basically the about us and client enquiry page have a second navigation, but no matter what page I'm on, the second nav is always displaying (even on the homepage where there is no second nav), the about us page second navigation is always overlaying the second nav from the client enquiry page even through they are different second navigations.

Re: [dsternalski] Navigation

By Jason - November 17, 2010

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/

Re: [Jason] Navigation

By dsternalski - November 21, 2010

Hi,

The reason that Current Vacencies is hard coded in at the moment is because I haven't added this section in. This will use the getCatergories.

The homepage, register with us and contact us use getRecords as these aren't going to have any second navigation. The navigation that uses getCategories will use the second navigation.

The reason that the navigation isn't hard coded is so that the main nav names can be changed in the CMS by the user.

Re: [dsternalski] Navigation

By Jason - November 22, 2010

Hi,

Okay, I think I see where you're going. So for each record set you have, you'll need to output the first record and then only output records after that if $thisPage is set to display those records.

Give this a try and let me know if you have any questions.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Navigation

By dsternalski - January 8, 2011

Hi,

Sorry for the delay in the reply.

The navigation displays as it should, however, when i click through to a link on the second nav, the address bar displays the new address, but the page doesn't display the correct content.

Please find attached the navigation.php.

Re: [dsternalski] Navigation

By Jason - January 10, 2011

Hi,

The file navigation.php didn't get attached. Could you please try attaching it again. Also, if you could provide a url to a page that demonstrates the problem, it will be easier to troubleshoot.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Navigation

By dsternalski - January 11, 2011

Hi,

please find navigation attached. I am in the process of putting this on a test site, so will send over a link once it is set up.
Attachments:

navigation_011.php 4K

Re: [dsternalski] Navigation

By Jason - January 11, 2011

Hi,

I've taken a look at your code and I can't see any problems there. I'll need to actually be able to see this script run to see what's happening.

What exactly is the nature of the problem? When you click on a link is it going to the wrong page, or just displaying the wrong content? Is it generating errors?

Let me know.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/