We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42042
    • 140 Posts
    Hi all,

    I'm trying to get random links in wayfinder and I can't get is to work.
    I've read something about &sortBy=`random` but that doesn't do the trick

    My call is like this:

    [[Wayfinder?
    &startId=`6`
    &level=`1`
    &limit=`7`
    &rowTpl=`C.tmpl.list-menu`
    &outerClass=`list-menu`
    &includeDocs=`7,8,9,10,11,4,12,14,16,17,18,19,20,21,22`
    &sortBy=`random`
    ]]

    Any suggestions?



    Thanks in advance smiley

    This question has been answered by paulp. See the first response.

      • 9995
      • 1,613 Posts
      You can use Ditto smiley
        Evolution user, I like the back-end speed and simplicity smiley
        • 42042
        • 140 Posts
        Quote from: fourroses666 at Feb 20, 2013, 03:20 PM
        You can use Ditto smiley

        Thanks for telling me! Didn't know 'ditto'. What's the difference between ditto, wafinder and getResources? I'd like to fix this with wayfinder tough.
          • 9995
          • 1,613 Posts
          I dunno how to do with wayfinder.
          I think this must work:

          [!Ditto? 
          &parents=`123`  
          &tpl=`chunky`
          &limit=`99`
          &display=`99`
          &total=`99` 
          &sortBy=`pub_date` 
          &sortDir=`DESC` 
          &randomize=`1`
          !]


          Chunky:
          <ul>
          <li><a href="[~[+id+]~]">[+alias+]</a></li>
          

          </ul>
            Evolution user, I like the back-end speed and simplicity smiley
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            If our friend has his Wayfinder properties set out like that then he must be using Revo. So instead of Ditto he'd use getResources.

            Wayfinder will make a nested list, while getResources makes a flat list.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 42042
              • 140 Posts
              Thanks for your comment @sottwell. It's true I use revo.

              The good news is: &sortBy=`random` is actually working. The bad news is I have to clear the 'site cache' in the manager to see it sort it in random order. Any suggestions?


              Thanks!
              Ilja
              • discuss.answer
                • 22840
                • 1,572 Posts
                Call it un cached

                [[!Wayfinder? 
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Correct. All the listing snippet (getResources, Wayfinder, etc) should be called cached - unless - they will be doing something dynamic, something that you want to change on every page view. Otherwise, the snippet is processed, its tags are replaced by its output, and the page is cached. Next time, the page is served from cache; no snippet is there to process. Uncached snippets are processed after the page is cached, so the cached version still has the snippet tags to get processed on every page request. Use with caution, though; it can slow your site down to have to process the snippet on every page load.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 42042
                    • 140 Posts
                    Great tip and thanks for the info about cache! I'll try to call it whit ! And see how the speed will be.

                    Great guys!
                      • 42042
                      • 140 Posts
                      The ! did the trick for my wayfinder! Didn't notice any speed difference smiley
                      I tried the same trick with my 'Gallery' component but that didn't work.