Author Topic: css and showmenu2  (Read 4565 times)

Offline terrajohn

  • Posts: 43
css and showmenu2
« on: January 19, 2010, 02:32:44 AM »
I have been trying already a lot of things but it seems I can't get things right...
I have a menu consisting of two levels. I use the showmenu2 in the correct way. I get all the menu etc...
But apparently I can not change the font color for the current item (using the .menu current class - i can add borders, background color - but when defining the font color it has no effect....)

I want the following

ITEM 1
ITEM 2
    item 1
    item 2
    item 3
ITEM 3
ITEM 4
....

Where ITEM : bold and other color when active
Where item : should be normal and other color when active

Any suggestions here (i already took a look at the www.websitebakers.d e/sm2/ site as well as the posts on this forum)

thanks in advance

erpe0812

  • Guest
Re: css and showmenu2
« Reply #1 on: January 19, 2010, 09:57:43 AM »
Hi
would be nice if you post your sm2 call and a link to your homepage.
This makes helping easier  :wink:

rgds

erpe

Offline terrajohn

  • Posts: 43
Re: css and showmenu2
« Reply #2 on: January 19, 2010, 12:15:36 PM »
This is the latest version I'm using:

Code: [Select]
<?php show_menu2(0SM2_ROOT+1SM2_CURR+1); ?>
But I have tried multiple different variatons (including the extend one):
Code: [Select]
<?php show_menu2
                                
$aMenu          0,
                
$aStart         SM2_ROOT+1
                
$aMaxLevel      SM2_ALL,        
                
$aOptions       SM2_TRIM|SM2_PRETTY,
                
$aItemOpen      = &#39;<li><a href="[url]" target="[target]">[menu_title]</a>&#39;,
                
$aItemClose     = &#39;</li>&#39;,
                
$aMenuOpen      = &#39;<ul class="leftside">&#39;,
                    
$aMenuClose     = &#39;</ul>&#39;,
                
$aTopItemOpen   false,
                
$aTopMenuOpen   false
                 
);
                  
?>

Concerning the $aMenuOpen class - I have been working with as well as without this class

The CSS is (leftside being the div in which the menu is positioned) - it is a bit messy because of the trial and error:
Code: [Select]

#leftside
{
clear: left;
width: 150px;
margin: 0 auto;
font-size: 11px;
float: left;
margin:0 0 5px;
padding:0;
}

#leftside ul
{
padding: 0px;
margin: 6px 0 0 10px;
color: #707070;
display: block;
width: 150px;
font: Arial, Helvetica, sans-serif;
border: 1px solid #e60000;
}

#leftside ul ul
{
padding: 0px;
margin: 6px 0 0 10px;
color: #707070;
display: block;
width: 139px;
font: Arial, Helvetica, sans-serif;
font-weight: normal;
border: 1px solid;
}

#leftside ul ul li
{
padding: 0px;
margin: 6px 0 0 10px;
color: #e60000;
display: block;
width: 139px;
font: Arial, Helvetica, sans-serif;
font-weight: normal;
}

#leftside ul li { display: block; padding-bottom: 8px;}

#leftside ul li a
{
text-decoration: none;
color: #707070;
}

#leftside ul li a:hover
{
color: #e60000;
}

#leftside .menu-current
{
font-weight: bold;
color: #e60000;
}

#leftside .menu-parent
{
font-weight: bold;
color: #e60000;
}

erpe0812

  • Guest
Re: css and showmenu2
« Reply #3 on: January 19, 2010, 12:22:12 PM »
try this:

Code: [Select]
#leftside .menu-current a
{
font-weight: bold;
color: #e60000;
}

rgds

erpe

Offline terrajohn

  • Posts: 43
Re: css and showmenu2
« Reply #4 on: January 19, 2010, 01:50:37 PM »
Erpe,

Thanks - this indeed does the trick for the current item in sublevel 2. But it seems you can't have and the current topmenu and the current submenu item differently styled
or you should maybe create ul li .menu current a and a ul ul li. menu current a style. I'll check this out later

It seems like I also still have an indent problem. To be sorted

erpe0812

  • Guest
Re: css and showmenu2
« Reply #5 on: January 19, 2010, 02:09:46 PM »
(mostly) everything is possible........... ... :wink:

Offline CodeALot

  • Posts: 512
  • Gender: Male
Re: css and showmenu2
« Reply #6 on: November 07, 2012, 03:49:33 PM »
Erpe,

Thanks - this indeed does the trick for the current item in sublevel 2. But it seems you can't have and the current topmenu and the current submenu item differently styled
or you should maybe create ul li .menu current a and a ul ul li. menu current a style. I'll check this out later

It seems like I also still have an indent problem. To be sorted

Yeah I know this is an old topic. But I just stumbled upon it and wanted to confirm that the last suggestion is right:

Create a ul ul li.menu-current a {  }   to have "active" pages in your submenu styled differently than the top level. Just tried that and it works :)