View Single Post
Old 10-04-2007, 01:07 PM   #2 (permalink)
scottdizzle
Contributing Member
 
scottdizzle's Avatar
 
Join Date: 04-13-07
Location: US
Posts: 293
iTrader: 0 / 0%
Latest Blog:
None

scottdizzle is on the right pathscottdizzle is on the right pathscottdizzle is on the right path
Send a message via AIM to scottdizzle Send a message via Yahoo to scottdizzle
I don't know the proper or easiest way to do it.. although I know there is a very nice PHP way of doing this.. I've seen people do it.. but here's how I do it. I cut out my categories or menus into a separate file such as menu.php and I then change the class of each area that needs to change.. for example say this is my menu:

Home, Games, Cars, Blog, Contact

When you're on the Cars page I want it to show up like this:

Home, Games, Cars, Blog, Contact

Now the person can tell they are on the Cars page and I don't need to waste any extra time telling and showing the person where they are.

So, in order to make this happen.. I already have menu.php cut out of my site.. So now I just make separate menu files with the necessary changes like this:

menu.php
menu-games.php
menu-cars.php
menu-blog.php
menu-contact.php

Now, depending on what page is loaded.. I include the proper menu file in my layout.. for example on the Games page I would use:

Code:
<?php include("menu-games.php"); ?>
and the code for menu-games.php would be something like this:

Code:
<style> a.menu1:link { color: #000000; text-decoration: none; } a.menu1:visited { color: #000000; text-decoration: none; } a.menu1:hover { color: #000000; text-decoration: underline; } a.menu2:link { color: #000000; text-decoration: underline; } a.menu2:visited { color: #000000; text-decoration: underline; } a.menu2:hover { color: #000000; text-decoration: underline; } </style> <a href="index.php" class="menu1">Home</a>, <a href="games.php" class="menu2">Games</a>, <a href="cars.php" class="menu1">Cars</a>, <a href="blog.php" class="menu1">Blog</a>, <a href="contact.php">Contact</a>
Notice.. slightly different styles for the classes menu1 and menu2.. and so I've set the hyperlink for Games to class="menu2"
__________________
I play music and make websites.
scottdizzle is offline   Reply With Quote