does anybody try or find how to use superfish with Menu Block
thank

Comments

JohnAlbin’s picture

Category: feature » support
Status: Active » Fixed

The docs for superfish are here: http://users.tpg.com.au/j_birch/plugins/superfish/

You need to use the "expand children" option of Menu block.

Then just use an appropriate jquery selector. Something like…

$('div.menu-name-primary-links>ul').superfish();

I haven’t tried it myself, but it seems straight forward.

pfx’s picture

Yes It works but for items menu inside the same block (with unselect expand all children).
What I would able to do is that item menu in the 1st level (primary) block enable an automatic open the 2nd level (secondary) block with child item menu.
Thank John

Status: Fixed » Closed (fixed)

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

gmclelland’s picture

How would you add the class "sf-menu" or class "sf-vertical" to a menu_block's UL?

For vertical menus see:
http://users.tpg.com.au/j_birch/plugins/superfish/#sample3

Is there so kind of theme override where I can add these classes?

Thanks for you help

gmclelland’s picture

Ok nevermind, I got it. For others interested.

go into includes/menu.inc

copy the theme_menu_tree function into your template.php and rename it yourthemename_menu_tree

then follow the documentation for menu block

theme_menu_tree() can be overridden by creating one of:
[theme]_menu_tree__menu_block()
[theme]_menu_tree__menu_block__[menu name]()
[theme]_menu_tree__menu_block__[block id number]()

so in my case it was

function cmftao_menu_tree__menu_block__1($tree) {
  return '<ul class="menu sf-menu">'. $tree .'</ul>';
}

Clear your theme registry and your good to go.