Forum Moderators: phranque

Message Too Old, No Replies

Menu tabs

how to highlight each tab for the correct page

         

proper_bo

11:10 am on Aug 13, 2004 (gmt 0)

10+ Year Member



Just starting a new site and I have made a menu that has several tabs. When you are in a certain area of the site I would like the correct tab to be highlighted. I'm after your opinions on the best way to do this.
Here are my ideas:
php - set a variable for menu eg (index.php&m=1)
- using php when I create each page to specify the menu wanted eg ($menu = 1;)
html - just adding the correct menu to the correct page (but therefore creating a menu for each section depending on which tab to highlight.

I'm not too keen on using dynamic urls unless I can master mod-rewrite. Easily doable? I could then use a ur like .com/1/index.php or .com/2/contact.php

any further ideas would be gratefully read and considered.

The site is for a school so simple (in all matters) = good for the users of all ages.

stef25

2:27 pm on Aug 13, 2004 (gmt 0)

10+ Year Member



dont really understand the above, but a good way to highlight your tabs is using css, namely a:active to set the properties for the active link

proper_bo

4:54 pm on Aug 13, 2004 (gmt 0)

10+ Year Member



I want to put more than one page (using a sub menu) into each section but still have the correct tab highlighted. I guess CSS won't work on more than the index page of the section to which the menu tab is directed?

______________________________
¦ one ¦ two ¦#three#¦ four ¦ five ¦
sub: a b c d e #f# g h

so here there are five tabs. At the moment I am in section 'three' and in the sub menu of section 'three' I am on page 'f'. I want tab three to remain highlighted for all pages I visit (a-h) as well as the index page for that tab.

Hope this makes it more clear.
Im after the simplest way to have the correct tab highlighted for all pages of that section.

proper_bo

11:31 pm on Aug 27, 2004 (gmt 0)

10+ Year Member



just to let anyone who comes across this topic know how I finally did this:

I used php to find the current directory I was in:

.co.uk/home/index.php OR
.co.uk/games/index.php

split the url using several commands and ended up with just 'games' or 'home' then used these to say:

if home then include this bit of menu
if games then include this bit of menu

works a treat and even better for working it out myself