We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30497
    • 245 Posts
    I have checked the Wayfinder and Ditto docs, but can’t find anything there to help me -

    What I would like to do is to create a dynamic menu that always excludes the document currently being viewed, i.e:

    I have a subsection of the site called "articles", with ~20 articles in there. At the bottom of each article, I want to provide the user with links to each other article, and preferably, to exclude the currently viewed article from that list.

    Is it possible with either Wayfinder or Ditto?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      &excludeDocs=`[*id*]` should do the job.
        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
        • 30497
        • 245 Posts
        thanks sotwell, but that is not a dynamic solution (unless I am missing something). I need it to automatically work for any document I add as a child to the "articles" parent. Using excludeDocs I would have to manually edit the call for each page.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          The [*id*] part will cause the excluded document to be the currently displayed page. I am sorry if I misunderstood; I thought that was what you wanted.
            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
            • 30497
            • 245 Posts
            Quote from: sottwell at May 13, 2008, 01:08 AM

            The [*id*] part will cause the excluded document to be the currently displayed page. I am sorry if I misunderstood; I thought that was what you wanted.

            ah, ok. ***I** misunderstood. I read it as you telling me to put the page ID there - my brain didn’t correctly parse the MODx markup - [* wink

            so, you method *is* what I am looking for. Thanks.
              • 30497
              • 245 Posts
              Quote from: sottwell at May 13, 2008, 12:52 AM

              &excludeDocs=`[*id*]` should do the job.

              Hi sottwell,

              Not sure if you are still watching this topic, or if anyone else can help, but I just got around to implementing this. Here is my call:
              [[Ditto? &parents=`[*parent*]` &excludeDocs=`[*id*]` &tpl=`ditto-minilist`]]

              and here is a page with that call at the bottom of the main content area:
              http://www.yoga-center.co.il/gabi

              but it doesn’t seem to exclude the document currently being viewed (first item in that list is the document being viewed, for those wondering what all those letters are). I am sure it is a silly mistake of mine - any ideas?

              thanks.
                • 4310
                • 2,310 Posts
                You could try:
                [[Ditto? &parents=`[*parent*]` &filter=`id, [*id*],2` &tpl=`ditto-minilist`]]

                That’s what I’ve used on several sites to exclude the current doc from Ditto results.
                  • 30497
                  • 245 Posts
                  Quote from: bunk58 at Jun 22, 2008, 01:36 PM

                  You could try:
                  [[Ditto? &parents=`[*parent*]` &filter=`id, [*id*],2` &tpl=`ditto-minilist`]]

                  That’s what I’ve used on several sites to exclude the current doc from Ditto results.

                  That’s great - works perfectly - thanks!
                    • 4310
                    • 2,310 Posts
                    I can see you’ve used it successfully on the site and got rid of the self link.
                    Glad it worked for you.
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      I was about to suggest a &hereTpl template chunk with no link...  wink
                        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