WebsiteBaker Support (2.8.x) > Templates, Menus & Design
show_menu2: valid XHTML and CSS selectable menus
bupaje:
I have a minor css issue and wonder if someone sees something obvious. This menu looks good in FireFox and IE7 but in IE8, unless I use compatibility mode, the menu li renders odd - double bullets or the link is below and right of the li. I'm not sure if this is IE8's problem or the structure I have here.
Here's a page that uses this and following is the code
http://stormvisions.com/pages/library.php
--- Code: ---$options = array('flags' => SM2_TRIM, 'notrim' => 1);
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 = '</li>',
$aMenuOpen = '</a></li><ul>',
$aMenuClose = '</a></ul>',
$aTopItemOpen = false,
$aTopMenuOpen = false,
$options
);
--- End code ---
brofield:
I can see a few issues.
Your open menu and close menu tags are strange. Put the closing </a> in the item open. Get rid of the </li> from menu close. i.e. menu open = '<ul>' and menuclose is </ul>. Item open is <li> ..., Item close is </li>.
The $options array should replace the $aOptions (was called aFlags) parameter if you are wanting to use it. i.e.
$options = array('flags' =>SM2_ALLINFO|SM2_PRETTY|SM2_TRIM, 'notrim' => 1);
... $aOptions = $options, ....
Try that.
B
bupaje:
Thanks brofield. That's what I needed.
pixotec:
I have defined multiple menues.
menu[3] is the "TopMenu" in two languages.
So I created
EN_TopMenu (Menu Link page) (level 0 in menu[3])
- Contact (level 1 in menu[3])
DE_TopMenu (Menu Link page) (level 0 in menu[3])
- Kontakt (level 1 in menu[3])
This menu is not in the path of the current page (let's say the homepage).
(So any use of SM2_CURR does not work).
I want to show only the TopMenu in the current language (EN -> Contact), so I tried:
--- Code: ---<?php show_menu2(3, SM2_ROOT+1, SM2_START, SM2_ALL, '[li][a][menu_title]</a>[/li]', '', '', '', false, false); ?>
--- End code ---
But I get both language links: Contact and Kontakt.
How to get only the TopMenu of the current language?
brofield:
You can't. Use a single menu tree with hidden branches for your special menus. Then you will be on the path and it will work.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version