3

I'm using the structure add-on and want to generate my main menu with it's submenu. In HTML it should look like this:

<ul id="navigation" class="toplevel">
  <li><a class="icon-home" href="">Home</a></li> 
  <li><a href="#">item 2</a></li>
  <li><a href="#" class="top active">item 3</a>
    <div class="sublevel">
      <ul class="container">
        <li><a class="active" href="">subitem 3.1</a></li>
        <li><a href="">subitem 3.2</a></li>
        <li><a href="">subitem 3.3</a></li>
      </ul>
    </div>
  </li>
  <li><a href="#">item 4</a></li>
  <li><a href="#">item 5</a></li>
  <li><a href="#">item 6</a></li>
</ul>

Using the structure code I should use:

{exp:structure:nav start_from="/" show_depth="2" css_class="toplevel" css_id="navigation"}

But this gives me the following HTML

<ul>
  <li></li>
  <li></li>
  <li>
    <a href="">item 3</a>
    <ul>
      <li class="first"></li>
      <li></li>
      <li class="last"></li>
    </ul>
  </li>
  <li></li>
  <li></li>
  <li></li>
</ul>

Does anyone know how to fix the menu as I suggested..?

1
  • On this blog post (caffeinecreations.ca/blog/foundation-structure-navigation) there are some options for better navigation aimed at using Foundation 3. In particular the bottom part which is copied from an email I received may be helpful. It's not exactly what you want, but could point you in the right direction.
    – CreateSean
    Jun 26 '13 at 20:22
2

Right now, you would need to use the Structure Entries plugin for custom nav markup: http://devot-ee.com/add-ons/structure-entries

0

Do you have a timeframe for when we'll be able to do this natively via Structure calls itself? Have been using sturcture entries in the past but i've been having some serious performance isseus with that plugin.

Peter himself has indicated on multiple places that adding features and reformatting the code to increase performance isn't something that's on his current todo list. This is in part because of him not using the plugin himself for the last few months.

I would really hate to have to switch to a different solution because i love the easy of use structure brings to my clients.

With kind regard, Bas van Ginkel

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.