We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19369
    • 1,098 Posts
    I don't know, it should work...try this then (again, change 3 depending on your website structure):
    [[treedepth:isequalto=`3`:then=`[[Wayfinder? &startId=`[[*parent]]` &level=`1`]]`:else=``]]
      • 22427
      • 793 Posts
      Some testing shows that the Parser seems to have problems handling the nestet snippet calls in the output modifier.
      As a workaround you can use a snippet without parameters, let's say named WFcall:
      <?php
      $startid = $modx->runSnippet('UltimateParent',array(
         'topLevel' => '4'
      ));
      $output = $modx->runSnippet('Wayfinder',array(
         'startId' => $startid,
         'level' => '1'
      ));
      return $output; 

      This snippets creates the same output like the Wayfinder call I gave above, using the API function modX.runSnippet.
      (If you prefer the reference to the parent, you can use the function modX.getParentIds.)

      Using the snippet above, the code would just be
      [[treedepth:isequalto=`3`:then=`[[WFcall]]`:else=``]]

      Edit:
      Corrected last line in snippet code:
      return $output; (instead of echo $output; )
      [ed. note: ottogal last edited this post 12 years ago.]
      • Th easiest way to accomplish what you want is via css and some jQuery to change the display of the child uls on click.

        Using the methods above you are using more resources from your server to render the navigation, wayfinder is a bit slow as it is with this your only making it slower, keep it simple just use css and jQuery.

        The beauty of MODX is you can do it anyway you want smiley
          Benjamin Marte
          Interactive Media Developer
          Follow Me on Twitter | Visit my site | Learn MODX
          • 19369
          • 1,098 Posts
          Quote from: benmarte at May 09, 2012, 03:56 AM
          Th easiest way to accomplish what you want is via css and some jQuery to change the display of the child uls on click.
          +1. Yes you're right, that's the way to go.