WebsiteBaker Support (2.8.x) > Templates, Menus & Design
show_menu2: valid XHTML and CSS selectable menus
crnogorac081:
I am not a coder, but based on my experience with WB, SM2 can not see hidden pages, if they are shown in menu, then they are not hidden, right :)))) and if SM2 can not see them, it can not create submenu :P correct me if i m wrong :)
brofield:
http://code.jellycan.com/sm2test/pages/parent/hidden-kids.php#currchild
This page is a hidden page that has children. Those children are shown correctly, see the test "currchild".
I guess the problem is you use of SM2_ROOT + 1 as the start. SM2 won't traverse through the hidden page to show the children. It doesn't even store information about hidden pages at the moment. It could be fixed to do so, but don't hold you breath waiting.
brofield:
Ok. I take that back, it is a bug. Fixed in version 4.8.
Download at http://code.jellycan.com/show_menu2/
See output with the following hidden pages:
http://code.jellycan.com/sm2test/pages/parent/hidden-nokids.php
http://code.jellycan.com/sm2test/pages/parent/hidden-kids.php
http://code.jellycan.com/sm2test/pages/parent/hidden-kids/child2.php
Cheers,
B
scottm52:
Having a coding quandry... Have used show_menu2 with alot of sites. But this time a customer haded over a template that is very convoluded and complex. And the css is damned near unreadable.
But, I have show_menu2 doing it. Cool. With a noted exception.. not so cool, and hence the question.
They're governing the highlighting of athe current page with a unique page id Which I can discover programmatically with SM2 pretty easily.
--- Code: ---<?php show_menu2(0, SM2_ROOT, SM2_ALL, '<li>[a] [if(id=current){id="current_tab"}] [menu_title] [/a]</li>'); ?>
--- End code ---
Now if you look close that call just won't work. But how would I set a hard id with an evaluation like this?
THX
scottm52:
--- Quote from: scottm52 on May 06, 2009, 10:04:11 PM ---Having a coding quandry... Have used show_menu2 with alot of sites. But this time a customer haded over a template that is very convoluded and complex. And the css is damned near unreadable.
--- End quote ---
When in doubt.. change the code... I went with the more sturctured call and it made it tons easier to debug...
<?php show_menu2(
$aMenu = 0,
$aStart = SM2_ROOT,
$aMaxLevel = SM2_ALL,
$aOptions = SM2_TRIM,
$aItemOpen = '<li><a href="[url]" id="[if(id==current){updates_tab}]"> [menu_title] [/a]',
$aItemClose = '</li>',
$aMenuOpen = '<ul id="tabMenu">',
$aMenuClose = '</ul>',
$aTopItemOpen = false,
$aTopMenuOpen = false
)
?>
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version