Jump to content


2nd level navigation


8 replies to this topic

#1 RustyNail

    Young Padawan

  • Members
  • Pip
  • 39 posts
  • Location:in my room

Posted 27 June 2005 - 07:28 PM

I want to create a navigation for a website that will have a primary navigation that when you mouse over on that another set of sub options will apply.

I need to have this menu appear on ever single page of the site.

I know html, css, photoshop, and flash. If the technique involves more than those I would appreciate it if you could be a little more detailed in that.

#2 Jaymz

    Retired P2L Staff

  • Members
  • PipPipPipPip
  • 4,104 posts

Posted 27 June 2005 - 07:38 PM

Do a quick search for "DHTML Drop Down Menus" and you'll find what you're looking for :P

#3 NGPixel

    Senior Programmer

  • P2L Staff
  • PipPipPipPip
  • 1,410 posts
  • Gender:Male
  • Location:Montreal, Canada
  • Interests:Web Design : Coding : Animation

Posted 27 June 2005 - 08:24 PM

Check www.guistuff.com, they have some DHTML drop-down box generators.

If you need it to appears on each page, using frames would be the easiest way but more optimized way would be to use a php include().

#4 RustyNail

    Young Padawan

  • Members
  • Pip
  • 39 posts
  • Location:in my room

Posted 28 June 2005 - 05:17 PM

The problem with frames is that if someone searches for one of the products, they will just get the frame with the product and nothing else. I suppose i could put somekind of link at the top of each page that says, click here if you came from a search engine but that seems kind of unprofessional.

Is there a way to get around this?
Could I some how make the nav with an image or I have heard of a php script that would put something on every page like frames?

Like I said I don't know php so if this is the best option I would appreciate some detailed help.

#5 NGPixel

    Senior Programmer

  • P2L Staff
  • PipPipPipPip
  • 1,410 posts
  • Gender:Male
  • Location:Montreal, Canada
  • Interests:Web Design : Coding : Animation

Posted 28 June 2005 - 06:32 PM

even if don't know PHP, its really easy to use that feature.

1) Simple copy the code of the navbar and put it in a file with no html coding (like , don't put that stuff)

Put at the end. Save the file as PHP. (.php)

2) In each file you want to put that navbar, simply put:

<?php include("YOURFILE.PHP"); ?>

thats all, your navbar will appear everywhere you put that little code. Don't forget to save all your files as .php as well.

<_<

#6 Jaymz

    Retired P2L Staff

  • Members
  • PipPipPipPip
  • 4,104 posts

Posted 28 June 2005 - 08:18 PM

Just one addition to what he said, set up your included page like this:

YOURFILE.PHP:
<?php

echo 'Paste your html stuff in here';

?>

Or you'll get a parse error <_<

#7 RustyNail

    Young Padawan

  • Members
  • Pip
  • 39 posts
  • Location:in my room

Posted 29 June 2005 - 04:29 PM

Thanks a lot.
I just want to make sure I understand something though
If I am right about this you don't need to reply just correct me if I'm wrong.

The pages other than the header will have a general template like this:

<html>
<head></head>
<?php
<?php include("nav.PHP"); ?>
<!--normal html for the page goes here-->
?>
</html>

saved as page.php

Thanks a lot for the help I will experiment with this becuase it will definetly come in handy for other sites that I would do.

#8 NGPixel

    Senior Programmer

  • P2L Staff
  • PipPipPipPip
  • 1,410 posts
  • Gender:Male
  • Location:Montreal, Canada
  • Interests:Web Design : Coding : Animation

Posted 29 June 2005 - 05:05 PM

hmmm, you've put 2 times a php tag. You only need 1.

<html>
<head>
<title>your title</title>
</head>
<body>
<?php include("nav.php"); ?>
<!--normal html for the page goes here-->
</html>

and your nav.php file should be:

<?php

echo 'Paste your html stuff in here';

?>

Thanks for fixing the little bug James lol

If your code is longer, you can just put no tag in your nav.php, so its just included, not parsed.

#9 RustyNail

    Young Padawan

  • Members
  • Pip
  • 39 posts
  • Location:in my room

Posted 29 June 2005 - 06:09 PM

My bad. Thanks!

Hate to bother you guys again but when I search for these on google all I seem to get is menu genuratoring(spelling) programs. I will keep searching and I already checked on w3schools. I was just wondering if anyone had a link from when they learned how to do it.


edit: After quite a bit of searching I think I finally found what I'm looking for. Here is a link for anyone else having problems with this stuff http://www.alistapar...cles/dropdowns/


edit 2: There is a slight problem since I need a vertical menu and not the horizontal menu that this tutorial shows. Is it possible to make a layer change from bottom to top or remain on top but be invissible untill the mouse moves over a certain spot?

I don't know how to make it un hidden but I think I could put a transparent gif on top of each link that acts as some kindof a link that would activate on the rollover to make the hidden layer visible again. Seems like this code would get messy and I would have to learn a bunch of new stuff. i hope someone else a suggestion to help me again.

Edited by RustyNail, 29 June 2005 - 09:16 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users