WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.8 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Menu problem!
  • Print
Pages: 1 [2]   Go Down

Author Topic: Menu problem!  (Read 18286 times)

Housy

  • Guest
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
Logged

Argos

  • Guest
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 == 3 | 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 »
Logged

Housy

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

Housy
Logged

Argos

  • Guest
Re: Menu problem!
« Reply #28 on: July 28, 2009, 09:57:21 PM »
Quote from: Housy on July 28, 2009, 09:06:25 PM
Thanks a lot Argos, it works really well :-D

Nice to know that it worked out well!  :wink:
Logged

  • Print
Pages: 1 [2]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Menu problem!
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2