WebsiteBaker Support (2.8.x) > Templates, Menus & Design
show_menu2: valid XHTML and CSS selectable menus
bupaje:
Thanks again. After trying a few things what seems to work is
--- Code: ---show_menu2(
$aMenu = 0,
$aStart = SM2_CURR+1,
$aMaxLevel = SM2_ALL,
$aFlags = SM2_ALLINFO|SM2_PRETTY,
$aItemOpen = '<li class="[class] button[page_id]"><a href="[url]" target="[target]" [if(level==0){class="topitem"}][if(level==1){class="subitem[page_id]"}]>[menu_title]',
$aItemClose = '</a></li>',
$aMenuOpen = '<ul>',
$aMenuClose = '</ul>',
$aTopItemOpen = false,
$aTopMenuOpen = false
);
--- End code ---
then I can
--- Code: ---<style type="text/css">.button167 .subitem167{font-weight: bold}</style>
--- End code ---
Probably not the best solution as I will have to add css to each page with the menu rather than a global type solution but seems to be the only sure way to get those first top elements. With the [sib] 1 thru 5 button 1 is applied at the first item if subitems and so on. My advanced css aren't existent. However this works so I am very grateful for your help - thanks!
vyni:
You are welcome.
Maybe someone else could give You a better solution - but this one is definitly working.
Now You are able to style every single button, if You want.
cu
bupaje:
Yes, it works perfect! :)
Lotus:
Got a small problem, pages assigned to $menu[2] only shows if i use $aStart = SM2_CURR.
info.php
--- Code: ---$menu[1] = 'Meny_ovre';
$menu[2] = 'Meny_undre';
--- End code ---
index.php
--- Code: ---<?php show_menu2(1,SM2_ROOT+1,SM2_START+1 ); ?>
<?php show_menu2(2, SM2_CURR ); ?>
--- End code ---
Page layout (The page is multilingual)
--- Code: ---SE <- Menulink to "PageSE1"
-PageSE1 <- Assigned to $menu[1]
-PageSE2 <- Assigned to $menu[2]
--PageSE2:1 <- Assigned to $menu[2]
GB <- Menulink to "PageGB1"
-PageGB1
etc..
--- End code ---
Problem
When using this configuration and pressing "PageSE2:1" all pages from the parent level disappear in $menu[2].
Using $aStart = SM2_ROOT+1 (as in $menu[1]), as i would prefer using, returns no menu at all.
I really need the parents to stay.
brofield:
Try passing the SM2_NOCACHE flag to the calls and see if that fixes the problem. This flag causes it to re-read all data from the database for each call. It may be a caching problem.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version