WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
<?php show_menu2( 0, SM2_ROOT+1, SM2_ALL, SM2_ALL|SM2_CURRTREE, '<li]"><a href="[url]" class="[class] navlev[level] group.$menucount">[menu_title]</a>', "</li>", '<ul class="ullev[level]">', "</ul>", true, '<ul id="header_menu" class="menu"><li class="home"></li>');'[if([leve]==1){$menucount=menucount+1 }]' ?>
.... '<li]"><a href="[url]" class="[class] navlev[level] group[page_id]">[menu_title]</a>',....
Was hoping I could replate [level] with another variable that changes for each menu top level item vs sub-menu's
.menu a.menu-0_2 { background-color: #0F0;}
<script> $(document).ready(function () { $('.menu-0').each(function(index){ $(this).addClass('menuColor'+index); }); }); </script>
.menu a.menuColor1 { color: #00F;}
<?php'<li]"><a href="[url]" class="[class] navlev[level]" style="background-image:url([menu_icon_0]);">[menu_title]</a>',
2) If you have jquery on your page and don't want to touch the original SM2 code, you can put this script in the head section of your template (of course after jquery is loaded):Code: [Select] <script> $(document).ready(function () { $('.menu-0').each(function(index){ $(this).addClass('menuColor'+index); }); }); </script>, where 0 in menu-0 is the level of the menu.Then you can define styles in your css selecting like this:Code: [Select].menu a.menuColor1 { color: #00F;}, where 1 of menuColor1 is the number of the menuitem, starting with 0.
Seems like I have several jquery files loading so I like option 2, but a little confused on what is the variable I would use for the class. I have tried menucolor[index] and a few other options, but not quite sure the code.