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.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


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 »
  • show_menu2 active state within childpages
  • Print
Pages: [1]   Go Down

Author Topic: show_menu2 active state within childpages  (Read 5767 times)

Offline noname8

  • Posts: 151
show_menu2 active state within childpages
« on: April 10, 2013, 11:09:33 AM »
This always breaks my nerves!  :evil: :? :-(

I have 2 menus, how to make the top on show the active state with all it's children
(even in 1.st level only)

my page structure is [lang]->[mainpages]->[subpages]
so 0. level is just for language

Top menu:
Code: [Select]
echo show_menu2(0, 480, SM2_START+1, SM2_TRIM |SM2_NUMCLASS|SM2_PRETTY|SM2_BUFFER, "[li][a][menu_title]</a>", '</li>', '[ul]', '</ul>', false, false);

When clicked top menu, it gives this html:
Quote
<li class="menu-1 menu-expand menu-current menu-first"><a title="page3" target="_top" href="http://localhost/site/pages/eng/page3.php">Page3</a>    </li>

sub menu:
Code: [Select]
echo show_menu2(1, SM2_CURR+1, SM2_START, SM2_TRIM |SM2_NUMCLASS|SM2_PRETTY|SM2_BUFFER, "[li][a][menu_title]</a>", '</li>', '[ul]', '</ul>', false, false);
Logged

Offline ruebenwurzel

  • Betatester
  • **
  • Posts: 8544
  • Gender: Male
  • Keep on Rockin
    • Familie Gallas Online
Re: show_menu2 active state within childpages
« Reply #1 on: April 10, 2013, 11:36:05 AM »
Hello,

try to style the .menu-parent in your css.

Matthias
Logged

Offline noname8

  • Posts: 151
Re: show_menu2 active state within childpages
« Reply #2 on: April 10, 2013, 12:16:14 PM »
Thank you
That will also style the not-currently-opened menu items.
What i meant that was to show the active state
Logged

jacobi22

  • Guest
Re: show_menu2 active state within childpages
« Reply #3 on: April 10, 2013, 01:27:32 PM »
Quote
That will also style the not-currently-opened menu items.
  :? :?

i didnt understand...

i have a vertical main menu and a submenu in the top (see pic), 2 menu-codes with separat ID for every menu

if i navigate only in main pages, the submenu is empty. if i click on the link "Tennis", this link becomes the class "menu-current" and the submenu open, if i click on a link in this submenu, the main link "Tennis" becomes the class "menu-parent" (and only this link) and the clicked link from the submenu becomes the class "menu-current"

if you have  same menus like that, you have to separat the classes in the css-file with the menu-ID, like this

mainlevel-nav is the ID for my submenu
Code: [Select]
ul#mainlevel-nav li a.menu-current
{       color: #ff0000;
}

my mainmenu has no ID, only the class mainlevel, i use the the DIV (container1) around the main menu in the css
Code: [Select]
#container1 a.menu-parent{color:#00ff00;}
#container1 a.menu-current{color:#ffff00;}

the pic: if i click on the main page "Tennis", the link is yellow = menu-current, if i click on a subpage from "Tennis", Tennis-Link is green ( menu-parent) and the current page in submenu is red
« Last Edit: April 10, 2013, 01:31:05 PM by jacobi22 »
Logged

Offline noname8

  • Posts: 151
Re: show_menu2 active state within childpages
« Reply #4 on: April 15, 2013, 03:30:05 PM »
Thank you Thank you  Thank you !

I have somehow confused menu-expand and menu-parent ! With this menu-parent it works like charm!
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • show_menu2 active state within childpages
 

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