We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33704
    • 2 Posts
    I did a few searches, but couldn’t find an answer for this.

    I’d like to have the wayfinder output for the second level nav not be nested inside the main list.

    Like this:
    <ul id="main-nav">
      <li><a class="selected" href="#">main 1</a></li>
      <li><a href="#">main 2</a></li>
      <li><a href="#">main 3</a></li>
    </ul>
    <ul id="sub-nav">
      <li><a href="#">sub 1</a></li>
      <li><a href="#">sub 2</a></li>
    </ul>
    


    as opposed to like this:
    <ul id="main-nav">
      <li><a class="selected" href="#">main 1</a>
        <ul id="sub-nav">
          <li><a href="#">sub 1</a></li>
          <li><a href="#">sub 2</a></li>
        </ul>
      </li>
      <li><a href="#">main 2</a></li>
      <li><a href="#">main 3</a></li>
    </ul>
    


    any advice? I tried a second wayfinder call using [*id*] as the startId, but that doesn’t work once you select one of the second level nav items.

    Thanks!
      • 4310
      • 2,310 Posts
      Try something like :
      <ul id="main-nav">
      	<li><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
      	</li></ul>[+wf.wrapper+]

      for the parentRowTpl and :
      <ul id="sub-nav">
      	<li><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
      	</li></ul>

      for the rowTpl
      This is just a pointer, you may need to do some work for the active templates.
        • 33704
        • 2 Posts
        that didn’t seem to work very well. I just got each item in it’s own <ul> list.

        some people seem to have solved this with css, but I haven’t figured out a way to do that either.

          • 22427
          • 793 Posts
          Hi _luke,
          try the following: Let the submenu be created by a Ditto call, not a Wayfinder call.

          Create a chunk named submenuchunk containing this:
          <ul class="submenu">
          [!Ditto? &parents=`[*id*]` &tpl=`yourtemplate` &display=`99` ...  !]
          </ul>

          and put the Ditto call into the content area of the document as {{submenuchunk }}.
          &parents=`[*id*]` lets the submenu list only the children of the actual document;
          yourtemplate is the chunk where you define the output for the submenu item.
          A high value for &display is needed to guarantee that all subitems are listed.
          (If you omit the parameter &display, its value is set to `3` by default - and you may
          wonder why you won’t get all of your subitems! - I lost some time on that...)