We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10076
    • 1,024 Posts
    Is it possible to build a menu where there is an option to sort asc or desc by alphabet on from the dir tree?
    Perhaps the answer is allready somewhere in this forum, but it is rather huge and a search did not bring results? If not, can Ditto do this?

    Cheers, frank.
      • 4310
      • 2,310 Posts
      REMOVED
        • 10076
        • 1,024 Posts
        edit: this did the trick, how simple can it be:
        [!Wayfinder?&startId=[[UltimateParent]]&sortBy=`pagetitle` &sortOrder=`asc`!]


        Thanks, frank. grin

        could i not use the &sortBy and &sortOrder?

        Would that be something like
        &sortBy='menutitle' &sortOrder='asc'

        Or would I have to try to alter the a variable in the wayfinder.inc.php?
        Any ideas? Because the above gives an error

        ...................You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''menutitle' 'ASC'' at line 1................ 
          • 25663 MODX Staff
          • 12,272 Posts
          Quote from: Frank at May 14, 2008, 12:48 PM

          &sortBy='menutitle' &sortOrder='asc'


          Backticks, not single-quotes: `

          While you’re at it, it really is a good idea to enclose your snippet call to ultimate parent in backticks too.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 10076
            • 1,024 Posts
            Like so?

            [!Wayfinder?&startId=`UltimateParent`&sortBy=`pagetitle` &sortOrder=`asc`!]
              • 4310
              • 2,310 Posts
              I think Ryan meant
              [!Wayfinder?&startId=`[[UltimateParent]]`&sortBy=`pagetitle` &sortOrder=`asc`!]
                • 10076
                • 1,024 Posts
                okay, thanks.
                  • 29181
                  • 480 Posts
                  I have had issues with this, if not all menu indexes are identical (0), anyone else?

                  Taff
                    Adrian Lawley: www.adrianlawley.com
                    • 25663 MODX Staff
                    • 12,272 Posts
                    I think "asc" needs to be uppercase too:
                    [!Wayfinder?&startId=`[[UltimateParent]]`&sortBy=`pagetitle` &sortOrder=`ASC`!]

                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me