The link was broken due to Foundation 4 being released, here's the link to where Foundation 3 docs live now:

http://foundation.zurb.com/old-docs/f3/navigation.php#vertical-nav

Comments

abelb’s picture

Assigned: abelb » jgraham

this seems like a use case for Sections. http://foundation.zurb.com/docs/components/section.html

Jeff, can we give a display option on menu for user?
Can we rebuild menus with the section syntax?

jgraham’s picture

Most likely any sections work will largely be dependent on the implementing site.

In order to make a general solution we have to make way too many assumptions that would probably be largely inadequate for most (all?) sites.

An example implementation is probably what we should look for with an eye towards factoring out any generalizable portions.

jgraham’s picture

Status: Active » Postponed
arancedisicilia’s picture

Hi.
I spent a couple of hours to figure out a theme solution, and came up with this hack on theme_menu.
It's a bit of a workaround, but it uses foundation base classes, so it may work for most cases.

function MY_THEME_menu_tree($variables) {
  global $cur_level;

  // get the number of top level links in the menu
  $num_top_level_children = count(menu_tree_page_data('main-menu'));
  if($cur_level == $num_top_level_children) {
     // if it's the main container, output the section syntax
     $return = '<div class="section-container accordion" data-section="accordion">' . $variables['tree'] . '</div>';
  } else {
     // if it's a sub-container, output the standard list. class "side-nav" for clean link style
     $return = '<ul class="side-nav">' . $variables['tree'] . '</ul>';
  }
  $cur_level++;

  return $return;
}
function MY_THEME_menu_link($variables) {
  $element = $variables['element'];
  $sub_menu = '';
  $element['#attributes']['data-section-content'][] = '';

  if ($element['#below']) {
    $sub_menu = drupal_render($element['#below']);
  }
  if ($element['#original_link']['has_children']) {
     // For top level links, output the foundation section style
     $return = '
        <section>
          <p class="title" data-section-title><a href="#">'. $element['#title'] .'</a></p>
          <div class="content" data-section-content>'.
            $sub_menu
          .'</div>
        </section>' . "\n";
  } else {
    // For children, output the standard link item style
    $output = l($element['#title'], $element['#href'], $element['#localized_options']);
    $return = '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
  }

  return $return;
}

Hope it helps!

abelb’s picture

Assigned: jgraham » abelb

great! I will test it out. thanks!

abelb’s picture

Issue summary: View changes

Fixed broken link that was pointing to old docs and 404