WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: stinkywinky on July 14, 2009, 05:33:35 PM

Title: show_menu2 problem: first level menu markup dissappears
Post by: stinkywinky on July 14, 2009, 05:33:35 PM
I use this code to show my menu. It works until i click on a second level item. The markup dissapears!

Example:

Item 1
|--- Subitem 1.1
Item 2
|--- Subitem 2.1
Item 3
|--- Subitem 3.1

When i enter the site, everything is perfect. When i click on, for example, subitem 1.1, the markup for Item 1, Item 2, Item 3 dissapears. If i go back to the root level of the site, everything is perfect again, until i click on a subitem.



What am i doing wrong ?


Code: [Select]
    <?php
     show_menu2
(
    
$aMenu          0,
    
$aStart         SM2_ROOT,
    
$aMaxLevel      SM2_ALL,
    
$aOptions       =  SM2_ALL,
    
$aItemOpen      = &#39;
    
[if(class!=menu-expand && level==0){[list][li][a][menu_title]</a></li>}]
    [if(class!=
menu-expand && level>&& class!=menu-last){<dd>[a][menu_title]</a></dd>}]
    [if(class!=
menu-expand && level>&& class==menu-last){<dd>[a][menu_title]</a></dd></dl>}]
    [if(class==
menu-expand){[list][li][a][menu_title]<!--[if gte IE 7]><!--></a><!--<![endif]-->}]
    [if(class==
menu-last && level==0){</ul>}]
    [if(class==
menu-last && level>0){</li></ul></div><!--[if lte IE 6]></td></tr></table></a><![endif]--></li>}]&#39;,
    
$aItemClose     = &#39;&#39;,
    
$aMenuOpen      = &#39;<!--[if lte IE 6]><table><tr><td><![endif]--><div><ul><li>[if(level>0){<dl><dt>Make a choise:</dt>}]&#39;,
    
$aMenuClose     = &#39;&#39;,
    
$aTopItemOpen   = &#39;&#39;,    
    
$aTopMenuOpen   = &#39;<ul id="block">&#39;
    
);
    
?>

Title: Re: show_menu2 problem: first level menu markup dissappears
Post by: erpe0812 on July 14, 2009, 05:44:09 PM
Hello

please read the html output of your page and see, which classes your first level items have ( I assume something with menu-parent).
Format the class in your css file and you are done.

It is always helpful to post a link to your site so everyone can have a look.

rgds

erpe
Title: Re: show_menu2 problem: first level menu markup dissappears
Post by: stinkywinky on July 14, 2009, 05:49:08 PM
The generated HTML code is exactly the same as on a root level page! That's what's so weird!
Title: Re: show_menu2 problem: first level menu markup dissappears
Post by: erpe0812 on July 14, 2009, 06:02:01 PM
Can you post a link?
Title: Re: show_menu2 problem: first level menu markup dissappears
Post by: stinkywinky on July 14, 2009, 06:39:17 PM
Found the solution! Second level pages without a submenu lose their classes;

<li class="menu-sibling"> becomes <li class="">

I didn't have any markup for li's without a class. Editing my CSS solved the problem!

Thanks for your help!
Title: Re: show_menu2 problem: first level menu markup dissappears
Post by: erpe0812 on July 14, 2009, 06:45:06 PM
Fine.

rgds

erpe