I can't find much documentation on theme_superfish. Can somebody provide some info on which mlid to use give a menu-name. Each link has it's own mlid, so I'm not sure which one to use. Also what are the sfsettings available? Is there a list, or should I just figure out each setting from hook_block_view?

Comments

arosboro’s picture

Here's how I got it to work:

In preprocess-region.inc:

    <?php
     $menus = og_menu_get_group_menus(array($space->group->nid));
     $menu = array_shift($menus);
     $sfsettings = array(
       'depth' => -1,
       'type' => 'horizontal',
       'style' => 'none',
       'firstlast' => 1,
       'zebra' => 1,
       'dfirstlast' => 0,
       'dzebra' => 0,
       'itemcount' => 1,
       'itemcounter' => 1,
       'itemdepth' => 1,
       'ulclass' => '',
       'liclass' => '',
       'hlclass' => '',
       'wrapmul' => '',
       'wrapul' => '',
       'wraphl' => '',
       'wraphlt' => '',
       'linkdescription' => '',
       'hldmenus' => '',
       'hldexclude' => '',
       'megamenu' => 0,
       'megamenu_depth' => 1,
       'megamenu_levels' => 1,
       'megamenu_exclude' => '',
     );
 
     $sf_vars = array(
       'id' => 'og-menu',
       'menu_name' => $menu->mname,
       'mlid' => 0,
       'sfsettings' => $sfsettings,
     );
 
     $sfoptions = array(
       'pathclass' => "pathClass: 'active-trail'",
       'pathlevels' => "pathLevels: '1'",
       'delay' => 800,
       'animation' => "width: 'show'",
       'speed' => "speed: 'normal'",
       'arrow' => "autoArrows: false",
       'shadow' => "dropShadows: true",
       'hoverintent' => '',
     );
     $sfoptions = implode(",\n", array_filter($sfoptions));
 
     $sfplugins['touchscreen'] = '.sftouchscreen()';
     $sfplugins['supposition'] = '.supposition()';
     $sfplugins['bgiframe'] = ".find('ul').bgIframe({opacity:false})";
     $sfplugins = implode('', array_filter($sfplugins));
 
     $supersubs = '.supersubs({minWidth: 12, maxWidth: 27, extraWidth: 1})';
 
     $javascript = "jQuery(function(){\n" . "jQuery('#superfish-og-menu')" . $supersubs . ".superfish({\n" . $sfoptions . "})" . $sfplugins . ";\n})    ;";
 
     $vars['og_menu_block'] = theme('superfish', $sf_vars);
     drupal_add_js($javascript, array('type' => 'inline', 'weight' => 100));
     if ($sfsettings['style'] != 'none') {
       if (module_exists('libraries')) {
         drupal_add_css(libraries_get_path('superfish') . '/style/' . $sfsettings['style'] . '.css');
       }
     }
 ?>
lobsterr’s picture

Issue summary: View changes
Status: Active » Closed (outdated)