We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8271
    • 9 Posts
    Hi, this is my first post.

    I want to show a navigation which show every container (only container) under a resource. How can I achieve that with wayfinder?

    Some container may have children or not.

    &level is not an option because a container may have different depth,
    Using Hide from menu also not an option.

    Edit:
    ========

    Solved by adding a new parameter, I called it &folderOnly. It still needs testing though laugh

    Modified wayfinder.class.php attached

    ========

    Thanks,

    dvio [ed. note: dvio last edited this post 14 years, 10 months ago.]
      • 33968
      • 863 Posts
      Not sure exactly what you were doing but you can specify either a class name or custom row template for resources that are a container:

      http://rtfm.modx.com/display/ADDON/Wayfinder

      Always better to try that first than to make code changes - it can be difficult to track what you've changed and then wonder why everything breaks when you upgrade some time later smiley
        • 8271
        • 9 Posts
        I introduced a new option &folderOnly and add isFolder=>1 to the getData query.

        the modification is here
        https://github.com/dvio/Wayfinder/commit/770551b104b966bdcb710853dc9f543bf0a1e619

        I don't know if it's the right way or else, but it's work for me.

        @Lucas thank you, yes I have tried the class and the template option, but I don't want to add extra function in the template since I will have a lot of resource, and I'm afraid it will affect the performance, will it?
          • 8271
          • 9 Posts
          Anyway, I'm using &where=`{"isfolder":1}` right now (while waiting the parameter to be added to the master (I hope)) laugh


          I think using &where=`{"isfolder":1}` is saver and performance friendlier laugh


          the call example:


          [[!Wayfinder? &startId=`17` &where=`{"isfolder":1}`]]
          [ed. note: dvio last edited this post 14 years, 10 months ago.]
            • 13808
            • 61 Posts
            Thanks for sharing that the 'Where' clause works with Wayfinder! Saved me heaps of time trying to solve the exact same thing.