When all children of a menu item are inaccessible (because the user doesn't have access to them), Nice Menus will generate an empty unordered list. For example if you include the default Weblog menu item in your menu (which contains child link My Weblog), and view the menu as an anonymous visitor, the HTML output will look something like :

<ul class="nice-menu nice-menu-down" id="nice-menu-1">
  <li id="menu-220" class="menuparent menu-path-blog"><a href="/blog" title="">Blogs</a><ul></ul></li>
  ...
 

The empty unordered list is the <ul></ul> part right after the link, which is invalid under the XHTML specifications.

Attached to this comment is a small patch for the 6.x CVS head version which in theme_nice_menu_build() checks the variable $children if it is set and only if it is set, will output the unordered list.

Hope this helps.

Comments

add1sun’s picture

StatusFileSize
new1.48 KB

Good catch! The patch is good but I'd really like to also remove the menuparent class from the LI as well since it looks stupid to have an arrow to nothing.

I've attached a patch that addresses this as well.

add1sun’s picture

Status: Needs review » Fixed

Added to 6 dev and HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.