Hi guys!

Trying to figure out how to make for Omega Theme a two-level menu which looks similar to ; http://www.telegraph.co.uk/news/, I finaly decided to use a great module Superfish.

With this module I created block with Main menu designed in navbar style. But the problem is that I cannot fix the second level menu always opened.

Does anybody know how to do it?

I use Drupal 7.12 and Omega 7.x-3.1.

Mentioned menu is Main menu. All parented items marked as Show extended

In Superfish block I used following options:
Menu Depth - 2
Menu Type - NavBar
Path class - sf-menu sf-navbar ( as mentioned in http://users.tpg.com.au/j_birch/plugins/superfish/#sample4)
Path levels - 2

Regards Oleg

Comments

marcoka’s picture

Project: Omega » Superfish Dropdown Menu
Version: 7.x-3.1 » 7.x-1.9-beta4

This has nothing to do with omega. Your question is about superfish functionality.

mehrpadin’s picture

Privet,

Just change the Path class back to active-trail :)

oo_nn’s picture

Privet!
I have changed Path class back to active-trail, but it did not help. Second level menu is still collapsing, when I do not point on yhe first level item :(

mehrpadin’s picture

Are you sure you're using the v1.9-beta4?

oo_nn’s picture

Yes, I'm sure. To be shure I even reinstall beta 4.

I tried V1.8 and v1.9-beta4. I found that they are slightly different in CSS. But both of them gave me the same result: second level of menu collapses despite Path class is active-trail or any other.

You can check it by youself at new-m3m.ru at 178.79.145.82.

tegia’s picture

Hi,

I have exactly the same problem with this version (although I don't use Omega but another third-party theme) ...

If someone have a solution, I am very interested !

Versions:

  • Drupal: 7.12
  • Superfish: 7.x-1.9-beta4

Thierry

tegia’s picture

Hi again,

My mistake !

I installed a (close but) wrong version of Superfish library in "sites\all\libraries" !!!

The correct version is "superfish-library-for-drupal-v1.2-beta.zip" :-)

It's working fine now ...

Regards

Thierry

tegia’s picture

Actually, the problem occurs randomly :-(
(user cache is activated in drupal)

==> Hmm, NO ... It's solved. Executing "Clear all cache" was just needed :-)

oo_nn’s picture

Hi Thierry!

Would you please explain were did you find "superfish-library-for-drupal-v1.2-beta.zip"? On https://github.com/mehrpadin/Superfish-for-Drupal I found only "mehrpadin-Superfish-for-Drupal-1.0-4-g1571b1d.zip" :(

Thank you

Oleg

Dew’s picture

I could ask for writing what and which file must I modify so that the menu is always open in?

mehrpadin’s picture

Олег, that's the same thing, just weird package naming by GitHub (library packages used to be on Dropbox). Also, I can't access your website.

Tomasz, original issue answered.

tegia’s picture

Hello Oleg,

Sorry for late, I was busy on other critical subjects ...

Please try this (non official) link: http://dl.dropbox.com/u/22795799/superfish-library-for-drupal-v1.2-beta.zip

Best regards,

Thierry

broon’s picture

Hey there,

I am experiencing the same issue. I am using

  • Drupal 7.12
  • Omega 7.x-3.1
  • Superfish 7.x-1.9-beta4
  • Superfish Library for Drupal 1.2-beta

I created a menu with two depths. The superfish block is configured to work with two levels and to have both levels open at all times. Path class is "active-trail". However, upon page load the second row is not being displayed. I have to hover the first-level menu item to have it show up. Also, there's no "active-trail" class set anywhere.

Anything I am missing?

UPDATE (20120503): Second level is now showing up. Still, active-trail class is still missing from parents.

oo_nn’s picture

I also noticed that something was wrong with active-trail

oo_nn’s picture

Hi, Paul!

How did you make it work?

Oleg.

broon’s picture

Actually, I am not really sure of what finally caused it to work. But I ran update.php in between and cleared the cache several times. I strongly assume it has been a cache issue.

oo_nn’s picture

Updated everything, cleared the cache a dozen times. Still does not work. :(

loparr’s picture

I am facing the same issue, using ver. 7x1.8 I can not find 1.9 anywhere :/
Did someone managed to show both levels at the same time?

edit: OK , I found the 1.9 version, was not inside download box though.
I am using the mehrpadin-superfish 1.0.4 version of library
I found a checkbox in block settings - take expanded option into effect - but no change.
any ideas?
my site is test.vypadavanie.net

thank you

broon’s picture

@loparr: For module version 1.9 you should use superfish library version 1.2!

I was playing around with superfish and tried to debug some variables. I found the following pattern. For my site I have special content type which is used for all main menu items. Thus, all primary (1st level) items link to a node. If a menu item from second level links to a view, superfish works as expected, upon page load the submenu (2nd level) is already opened and some css classes are present (`sf-breadcrumb`for the parent and `active` for the current menu item).

However, if the submenu item links to a node, nothing works. In superfish.module function `superfish_build_page_trail()` I debugged the `trail` variable and while its content is correct for a view, the variable stays empty if the link target is a node.
Also, if clicking on a primary item (1st level) superfish doesn't work either (since it's a node). If I add a view to the 1st level, superfish works for that menu item.

broon’s picture

Status: Active » Needs review

I finally found a solution to fix the nasty Drupal core bug regarding the active-trail. Thanks to http://www.designhammer.com/blog/active-trails-menu-items-drupal-7 and the two lines of code mentioned there, every single menu is working as expected now.

I tried Drupal core menu, Menu block as well as Superfish, they are now all getting the appropiate "active" and "active-trail" classes.

SNaKeMe’s picture

Hi Paul B.,

i have the same bug with the nodes in the menu. how do you edit the "trail" variable? can u post your code here?

/**
 * Builds the active trail from the page's menu data.
 */
function superfish_build_page_trail($page_menu) {
  $trail = array();
  foreach ($page_menu as $item) {
    if ($item['link']['in_active_trail']) {
      $trail[] = $item['link']['mlid'];
    }
    if ($item['below']) {
      $trail = array_merge($trail, superfish_build_page_trail($item['below']));
    }
  }
  // Allows other modules to alter the active trail.
  drupal_alter('superfish_active_trail', $trail);
  return $trail;
}

have corolla theme installed.

maxview’s picture

I used latest version of all needed scripts, but still got one problem, the sub menus under "home" menu wouldn't keep open when the "home" is selected.

broon’s picture

Hey SNaKeMe,

sorry for replying so late, I totally missed your request.
Actually, all I did was to use devel's "Execute PHP" functionality and run the two lines mentioned in the article:

$active_menus = array('navigation', 'management', 'user-menu', 'main-menu', 'primary-links');
variable_set('menu_default_active_menus', $active_menus);

Of course, you need to alter the first line to resemble your menu machine names.

Paul

jchin1968’s picture

Hi assenal.

Did you get #23 resolved? I'm having the same problem where if I'm on the home page the sub-menus for home don't stay open unless the mouse is hovering over it. But, if I'm on a different page, the sub-menus are working correctly and do stay open. Thanks.

Joe.

maxview’s picture

Hi jchin1968,

It's done: http://www.marketingthread.com

Don't use the default home page setting, use other url containing no "front". < and > are filtered here, you know what I want to tell.

theohawse’s picture

Status: Needs review » Closed (works as designed)

Guys, open a new issue if your still having difficulties cheers!