We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12410
    • 353 Posts
    Hi Guys,
    How can I adjust this to show newest entries first please?
    [[!Wayfinder?
      &startId=`[[UltimateParent? &topLevel=`0`]]`
      &outerTpl=`vertNavmenuOuter`
      &rowTpl=`horizNavmenuRow`
      &innerTpl=`horizNavmenuInner`
      &innerRowTpl=`horizNavmenuInnerRow`
      &hereClass=`current_page_item`
      &firstClass=``
      &lastClass =`` 
      &sortOrder =`ASC` 
      &limit=`10`]]
      


    &sortOrder =`ASC` seems to have no effect. Tried &sortOrder =`DESC` too?

    Thanks
      • 22427
      • 793 Posts
      If you don’t explicitely give a value for the parameter [tt]&sortBy[/tt] , Wayfinder will take [tt]`menutitle`[/tt] as default value for it.
      To get the newest entry on top, write
      &sortBy=`published` &sortOrder=`DESC`


      Edit:
      &sortBy=`published` &sortOrder=`DESC`
      should be
      &sortBy=`pub_date` &sortOrder=`DESC`

      (See post #5 below.)
        • 12410
        • 353 Posts
        Hi there,

        I tried



        [[!Wayfinder?
          &startId=`[[UltimateParent? &topLevel=`0`]]`
          &outerTpl=`vertNavmenuOuter`
          &rowTpl=`horizNavmenuRow`
          &innerTpl=`horizNavmenuInner`
          &innerRowTpl=`horizNavmenuInnerRow`
          &hereClass=`current_page_item`
          &firstClass=``
          &lastClass =`` 
          &sortBy=`published`
          &sortOrder=`DESC` 
          &limit=`10`]]


        and

        [[!Wayfinder?
          &startId=`29`
          &outerTpl=`vertNavmenuOuter`
          &rowTpl=`horizNavmenuRow`
          &innerTpl=`horizNavmenuInner`
          &innerRowTpl=`horizNavmenuInnerRow`
          &hereClass=`current_page_item`
          
          &sortBy=`published`
          &sortOrder=`DESC` 
          &limit=`10`]]


        buy wayfinder refuses to sort for me. It displays with oldest first all the time. I must have installed the "Murphy’s Law Plugin" somewhere along the line coz if there is a bug I will find it! smiley

        Any ideas what else it could be guys? Caching, System settings, some chunk or code in wayfinder?

        THANKS
          • 12410
          • 353 Posts
          Hi,
          I see it could be a mysql 5 issue from other threads.

          I’m running MySql 5.0.83, php 5.2.9, rev 2.0.8 and Apache/2.2.11 (Unix)

          re:MySQL 5.0.51
          http://modxcms.com/forums/index.php/topic,23647.0.html
          http://modxcms.com/forums/index.php/topic,23676.0.html
          http://bugs.mysql.com/bug.php?id=35181

          Surely its fixed by MySql 5.0.83?

          Can I adjust the wayfinder code to fix?

          I even looked thru wayfinder.class.php and there aint no Group By stuff in there
          and changing the defaults in there:
          ’sortOrder’ => ’ASC’,
          ’sortBy’ => ’menuindex’,

          to DESC and published did nothing. Hmmm

          Thanks
            • 22427
            • 793 Posts
            Sorry, my mistake:
            Of course you need
            &sortBy=`pub_date` &sortOrder=`DESC`

            (The variable [tt]published[/tt] has value 0 or 1 indicating the state of the document: 0 = unpublished, 1 = published )
              • 12410
              • 353 Posts
              Cheers this worked for me:
              [[!Wayfinder?
                &displayStart=`1`
                &outerTpl=`vertNavmenuOuter`
                &rowTpl=`vertNavmenuRow`
                &innerTpl=`vertNavmenuInner`
                &innerRowTpl=`vertNavmenuInnerRow`
                &hereClass=`current_page_item`
                &firstClass=``
                &lastClass =`` 
                &sortBy=`publishedon`
                &sortOrder=`DESC` 
                &limit=`10`]]


              By the way have you ever gotten phpthumbof working in a subdirectory ie if my site was in root/modx?
              I ended up having to upload phpthumb itself to components and call it from there. Some people say it doesnt work in a subdirectory due to a bug. Just wondering.
              Thanks
                • 3749
                • 24,544 Posts
                FYI - pub_date will only work if you set a future Publish On date for each resource.


                These are usually better choices:

                publishedon - The date the resource was saved as published or published automatically.

                createdon - The date the resource was first saved.

                editedon - The date the resource was last edited.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 22427
                  • 793 Posts
                  [tt]publishedon[/tt] vs [tt]pub_date[/tt]:
                  Thanks, BobRay, for the clarification.
                    • 12410
                    • 353 Posts
                    Hi Guys,
                    How do I amend

                    [[!getResources? &parents=`0` &depth=`0` &limit=`15` &tpl=`footer_links`]]


                    to display the links as they are in the document tree? They appear to sort by published date in the above.
                    I am running two separate navs one for events so published desc order and one for general site links in the footer. Just parents no child links needed this time but with getresources.

                    Thanks
                      • 33337
                      • 3,975 Posts
                      &sortby=`menuindex` &sortdir=`asc` ?
                        Zaigham R - MODX Professional | Skype | Email | Twitter

                        Digging the interwebs for #MODX gems and bringing it to you. modx.link