WebsiteBaker Support (2.8.x) > Templates, Menus & Design
show_menu2: valid XHTML and CSS selectable menus
PeterM:
Would it be possible to incorporate this script into the standard WB zip-file. I didn't use this snippet to make the menus of my templates, because of the fact that it's not standard WB yet.
Some of my templates, for instance, K2 would have looked better with this template.
Stefan:
@PeterM
Definitely. I guess it could be a drop-in replacement for the current core menu (frontend::menu())
@brofield
Can you modify the wrapper functions page_menu() and show_menu() to utilize your script but keep the current order of parameters (for backwards compatibility) ?
bupaje:
Thanks! Decided to try this on my site and it works fantastic!
A minor CSS question ... I used this
.menu-child{
background-color: #F3F3F3;
border : 1px solid #EEEEEE;
}
.menu-current{
background-color: #DDDDDD;
border : 1px solid #16B144;
}
.menu-expand{
font-weight: bold;
}
and you can see if you go here http://stormvisions.com/pages/art-design/3dgamestudio.php that the second level pages with no subpages are bold instead of only the pages with subs. Any hints?
Three thumbs up!
brofield:
font-weight is inherited by the child menus. Try
.menu-expand > a { font-weight: bold; }
This will only modify the <a> links directly underneath a .menu-expand classed tag and no children.
B
brofield:
--- Quote from: Stefan on March 10, 2006, 09:25:57 AM ---@brofield
Can you modify the wrapper functions page_menu() and
show_menu() to utilize your script but keep the current order
of parameters (for backwards compatibility) ?
--- End quote ---
It is actually quite difficult due to the item formatting that show_menu uses. There are a few problems:
* the default item class. There is no such thing as a default item class that is used for every item EXCEPT FOR THE CURRENT ONE in show_menu2. This means that I can't generate exactly the same menus that show_menu currently is.
* the [class] replacement string. The class is automatically added to the last tag in the item open tag. This is different to the item format string.
* the item format string is combined with the open tag. In show_menu2 these are separated. I can probably rewrite it to be combined, but then it may not be possible to put the classes exactly where you want to.
Have done a first kick at changing sm2 such that a merge of show_menu and show_menu2 will be possible. It is running at the demo site now (see the README file there). Will continue to play a little to see what I can do.
B
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version