Author Topic: Menu problem!  (Read 7344 times)

Offline Housy

  • Posts: 39
  • Gender: Male
Re: Menu problem!
« Reply #25 on: July 26, 2009, 08:18:44 PM »
Hey, it's me again, if static way, how do i deal with the current/active link then? I have to check if page_id or something is equal to 1 for example and set the class="active" to home button.

This menus are killing me :|

Tnx, Housy

Offline Argos

  • Posts: 2542
  • Gender: Male
    • Argos Media
Re: Menu problem!
« Reply #26 on: July 26, 2009, 11:23:45 PM »
I have done what you are looking for on maycroft.com. The main menu (the green bar) are static links, like so:
Code: [Select]
<ul>
<li><a class="<?php if(PAGE_ID == ROOT_PARENT == 3) {echo &#39;activemenu&#39;;}?>" href="#">Risk Management</a></li>
<li><a class="<?php if(PAGE_ID == 4) {echo &#39;activemenu&#39;;}?>" href="#">Carbon Trading</a></li>
<li><a class="<?php if(PAGE_ID == 52 ROOT_PARENT == 52) {echo &#39;activemenu&#39;;}?>" href="#">Education</a></li>
<li><a class="<?php if(PAGE_ID == 2) {echo &#39;activemenu&#39;;}?>" href="#">Exchanges and Clearing</a></li>
</ul>
(I use # instead of real url's in this code example)
You see two menu items have the extra  bit
Code: [Select]
| ROOT_PARENT == to ensure that their children pages also cause the parent menu item to show the active status.

So you have to look up the page id's for each page, and create a css style for the actively selected status. Often that is the same as the hover style. So in my css file I have:

Code: [Select]
#mainmenu li a:hover,
#mainmenu li a.activemenu {
background: url('../images/mainmenu-back2-hover.gif') left top repeat-x;
}
« Last Edit: July 27, 2009, 12:39:20 AM by Argos »
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

Offline Housy

  • Posts: 39
  • Gender: Male
Re: Menu problem!
« Reply #27 on: July 28, 2009, 09:06:25 PM »
Thanks a lot Argos, it works really well :-D

Housy

Offline Argos

  • Posts: 2542
  • Gender: Male
    • Argos Media
Re: Menu problem!
« Reply #28 on: July 28, 2009, 09:57:21 PM »
Thanks a lot Argos, it works really well :-D

Nice to know that it worked out well!  :wink:
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

 

postern-length