IE6 issue solved by this patch.
Please review and include if it seems to be O.K.
Please note that I'm not a PHP programmer :)

CommentFileSizeAuthor
multiflex_0.patch1.35 KBgabrielakos

Comments

Minna’s picture

Thanks for working on this.

I tried this patch. I got the following error:

"Parse error: syntax error, unexpected $end in .../themes/multiflex37/template.php on line 137"

Could you help me with this?

Minna

gabrielakos’s picture

not really.
I guess you are applying the patch to a different version, or to a different file.
Maybe if you look at the file you'll find an unmatched parentheses or something like that.

Rgds,
Akos

jbp’s picture

Thanks a lot to gabrielakos - works perfect! Just to make the installation process crystal clear...

Find template.php: ../themes/multiflex37/template.php

Change these lines of code:

function phptemplate_menu_tree($pid = 1) {
  $msm = variable_get('menu_secondary_menu', 0);
  if ($tree = menu_tree($pid)) {
    $ul = $msm == $pid ? '<ul>' : '<ul class="menu">';
    return "\n$ul\n$tree\n</ul>\n";
  }
}

function phptemplate_menu_item($mid, $children = '', $leaf = TRUE) {
  $msm = variable_get('menu_secondary_menu', 0);
  $menu = menu_get_menu();
  if (in_array($mid, $menu['visible'][$msm]['children'])) {
    return '<li>'. menu_item_link($mid) . $children ."</li>";
  } else {
    return '<li class="'. ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) .'">'. menu_item_link($mid) . $children ."</li>\n";
  }
}

With these:

 function phptemplate_menu_tree($pid = 1) {
   $msm = variable_get('menu_secondary_menu', 0);

   if ($tree = menu_tree($pid)) {
     if ($msm == $pid) {
         $ulb='<ul>';
         $ule='</ul>';
     } else {
         $ulb='<!--[if lte IE 6]><table><tr><td><![endif]--><ul class="menu">';
         $ule='</ul><!--[if lte IE 6]></td></tr></table></a><![endif]-->';
     }
     return "\n$ulb\n$tree\n$ule\n";
   }

 }

function phptemplate_menu_item($mid, $children = '', $leaf = TRUE) {
   $msm = variable_get('menu_secondary_menu', 0);
   $menu = menu_get_menu();
   if (in_array($mid, $menu['visible'][$msm]['children'])) {
    return '<li>'. str_replace('</a>','<!--[if IE 7]><!--></a><!--<![endif]-->',menu_item_link($mid)) . $children ."</li>";
   } else {
     return '<li class="'. ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) .'">'. menu_item_link($mid) . $children ."</li>\n";
   }
  }

Good luck!
:-) JBP

nipsy’s picture

Well, not exactly. On IE6 for me and others, that code change makes each top level menu item become the full width of the browser and it becomes a square essentially, making each item roughly a 'page' in size.

Scrolling down ten pages gives the rest of the Drupal content for the site rendered normally.

Works fine in FF.

Nipsy

Microbe’s picture

I have poored long and hard over why this does not seem to work in IE6. and it was simple in the end - there was a missing because of the replace for IE7 the code i am now using is:

 function phptemplate_menu_tree($pid = 1) {
   $msm = variable_get('menu_secondary_menu', 0);

   if ($tree = menu_tree($pid)) {
    if ($msm == $pid) {
         $ulb='';
         $ule='';
     } else {
         $ulb='<!--[if lte IE 6]><table><tr><td><![endif]--><ul>';
         $ule='</ul><!--[if lte IE 6]></td></tr></table></a><![endif]-->';
     }
     return "\n$ulb\n$tree\n$ule\n";
   }

 }

 function phptemplate_menu_item($mid, $children = '', $leaf = TRUE) {
   $msm = variable_get('menu_secondary_menu', 0);
   $menu = menu_get_menu();
   if (in_array($mid, $menu['visible'][$msm]['children'])) {
     return '<ul><li>'.str_replace('</a>','<!--[if IE 7]><!--></a><!--<![endif]-->', menu_item_link($mid)) . $children ."</a></li></ul>";
   } else {
     return '<li class="'. ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) .'">'. menu_item_link($mid) . $children ."</li>\n";
   }
}

It seems to work fine when i use it although haven't tested it on IE7 or FF yet as i don't have access to them at the moment.

will post again later when i have tested them unless someone else is able to first.

Microbe

waynedrupal’s picture

Microbe: I have just put your code in my template.php page and uploaded that into my Multiflex37 theme and tested with IE7 and FireFox 2.0.0.5 and both work fine with drop down box :)

I have not tested this in IE 6 as I don't have that.

Microbe’s picture

Status: Needs review » Reviewed & tested by the community

Thanks if that works then the bug is fixed - it produces the exact code that the original theme did before it was ported to drupal. can someone make a patch so others can update it cos i don't know how.

Thanks
Microbe

Minna’s picture

Microbe:

Thanks. Drop down menus work in IE6, IE7 and FF. Thanks a lot.

Minna

karlene11’s picture

I've made these changes to two different sites with this theme and neither work in IE6. Same result as before the changes. Works great in FF and IE7. Any ideas?

scooper@drupal.org’s picture

The theme's drop-down menus work properly for me with IE 6/Windows 98. I used the following function replacements in template.php.

/* Patch for IE 6 drop-down menus */
function phptemplate_menu_tree($pid = 1) {
   $msm = variable_get('menu_secondary_menu', 0);

   if ($tree = menu_tree($pid)) {
     if ($msm == $pid) {
         $ulb='<ul>';
         $ule='</ul>';
     } else {
         $ulb='<!--[if lte IE 6]><table><tr><td><![endif]--><ul class="menu">';
         $ule='</ul><!--[if lte IE 6]></td></tr></table></a><![endif]-->';
     }
     return "\n$ulb\n$tree\n$ule\n";
   }

}

function phptemplate_menu_item($mid, $children = '', $leaf = TRUE) {
   $msm = variable_get('menu_secondary_menu', 0);
   $menu = menu_get_menu();
   if (in_array($mid, $menu['visible'][$msm]['children'])) {
    return '<li>'. str_replace('</a>','<!--[if IE 7]><!--></a><!--<![endif]-->',menu_item_link($mid)) . $children ."</li>";
   } else {
     return '<li class="'. ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) .'">'. menu_item_link($mid) . $children ."</li>\n";
   }
  }
/*******end patch ***********/
ahefele’s picture

I've applied this patch to the code. It works great in IE 6 if all the main links have sublinks (in a dropdown) below them. However, in IE 6 if you don't have a sublink, it blows up the that one main link. It's like it doesn't know how to handle not having sublinks in a dropdown menu below the main links. Is there a fix for this? Thanks for any help.