We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23377
    • 5 Posts
    Hi,
    i want to make a navigation menu for a site, where three different levels are used an every level should be displayed in a specific div-element. I experimented a bit with wayFinder and came to a solution..but only for the first two levels:

    <div id="top-navigation">
    [[Wayfinder? &startId=`0` &level=`1`]]
    </div>
    <div id="sub-navigation">
    [!Wayfinder? &startId=`[[UltimateParent]]` &level=`1`!]
    </div>
    


    The problem is that i want the third level of the menu to be displayed too, but in an extra div.

    Thanks for your help
      • 10746
      • 126 Posts
      The right way to do it ... rewrite UltimateParent so that it takes a parameter that returns the docid at level "x" below the top level...

      The cheap-n-nasty way to do it: write a snippet that calls UltimateParent twice... call it PenultimateParent or SonOfUltimateParent or something...

      <?php
      $a = $modx->runSnippet('UltimateParent');
      $params['top'] = $a;
      $b = $modx->runSnippet('UltimateParent',$params);
      return $b;
      ?>


      Enjoy...

      Gordon
        • 23377
        • 5 Posts
        Hi, thank you for your reply, but this isn’t exactly what i wanted to do.
        For example my menu looks like this:

        A
        -a1
        --aa1
        --aa2
        B
        -b1
        --bb1
        -b2

        Now i want to have three seperated divs. every menulevel should be displayed in one of them.
        One div should contain A and B, another one a1, b1 and b2 and the third div schould contain the aa1, aa2 and bb1 links. So, i need a method to directly get the documents of a specific level. This isn’t possible by using ultimateParent, isn’t it?! Because it is relative to the active level you are in.
        I hope i described my problem clearly and maybe somebody has an idea.
        Thanks
          • 10746
          • 126 Posts
          Quote from: piezke at Jan 15, 2007, 05:42 PM

          Now i want to have three seperated divs. every menulevel should be displayed in one of them.

          Hmm.. why do you want to do that?

          Now I’m not sure what you mean ..

          Do you want

          <div id="subsubnav">
          aa1
          aa2
          bb1
          </div>

          without any of the upper levels being shown?

          With divs, you can only have one of each type on a page... so you could only have ONE "subsubnav" div..


          You can use Wayfinder to assign a different CLASS to each item at each given level if you wish to...