We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26641
    • 27 Posts
    I’ve read through some other posts and tried the suggestions of people that had the same problem.

    Here is my Ditto call in my template
    [!Ditto? &startID=`[!current_resource_id!]` &sortBy=`createdon` &sortDir=`ASC` &display=`5` &tpl=`blog_summary_list` &paginate=`1` &paginateAlwaysShowLinks=`1` !]
    
    <p>Showing <strong>[+start+]</strong> - 
    <strong>[+stop+]</strong> of <strong>[+total+]</strong> Articles 
    <strong>[+currentPage+]</strong> of <strong>[+totalPages+]</strong>
    </p> <div id="ditto_pages"> [+previous+] [+pages+] [+next+] </div>
    


    Whenever I try using an &id and update the placeholders accordingly, they don’t work at all.

    The page that uses the template is NOT cacheable. I’ve emptied the site cache.

    The current_resource_id just gets the current page id. I’ve also tried hardcoding a number to rule that out.

    So the problems are....
    The pagination doesn’t return the right number of results,
    The links don’t work,
    It just doesn’t work.

    Here is an example page that I’m looking at: http://www.timoleon.co.uk/index.php?id=156

    I’m expecting to have 6 results returned.

    Any ideas?


    PS Using Ditto 2.1 and Modx 1.0.0! Aye, just realized this was 1.0.0. Working on this with someone else that set it up.

    Does anyone know if that is actually the problem or not?
      • 36502 ☆ A M B ☆
      • 491 Posts
      Hi,
      if I remember correctly I don’t think you can call double uncached snippet, have you tried:
      [!Ditto? &startID=`[[current_resource_id]]` &sortBy=`createdon` &sortDir=`ASC` &display=`5` &tpl=`blog_summary_list` &paginate=`1` &paginateAlwaysShowLinks=`1` !]
      


      with [[current_resource_id]] uncached.

      And actually what does [[current_resource_id]] produce?
        TilliLab | MODX Ambassador
        website
        • 26641
        • 27 Posts
        Hey Pandro,

        It seems to work correctly. It does produce the correct id. This is the code of the snippet
        <?php
        echo $modx->documentIdentifier;
        ?>
        


        But like I said, I thought that might be an issue, so I hardcoded 156 in there as the startID when testing. So it definitely seems like more than that.
          • 36502 ☆ A M B ☆
          • 491 Posts
          well, if you are using Evolution you can just call this way:

          [!Ditto? &startID=`[*id*]` &sortBy=`createdon` &sortDir=`ASC` &display=`5` &tpl=`blog_summary_list` &paginate=`1` &paginateAlwaysShowLinks=`1` !]

          which version of Ditto are you using?

          I think you could call the snippet this way:
          [!Ditto? &orderBy=`createdon ASC` &display=`5` &tpl=`blog_summary_list` &paginate=`1` &paginateAlwaysShowLinks=`1` !]
          


          instead of startId you shoud use parents, but by default Ditto takes the current document as parent.
          But it depends if you are using an old version of Ditto.
          I think that Ditto 1 uses startId
          Ditto 2 uses parents




            TilliLab | MODX Ambassador
            website
            • 4310
            • 2,310 Posts
            Getting a 404 for http://www.timoleon.co.uk/index.php?id=156
            I seem to recall doing some work on that site a couple of years ago.
            Perhaps I customised Ditto, or some such thing.
              • 26641
              • 27 Posts
              Hey David,

              Yeah, sorry. That page isn’t published yet, forgot you might have to be logged in.

              Umm, hmm, okay. Well, if you think you might have changed ditto, I’ll just install a fresh copy to test out.

              Thanks.
                • 4310
                • 2,310 Posts
                I’ve found a Timoleon folder on my local machine laugh
                The only files relate to the FCK Image Editor, I remember doing a couple of modifications to the paths and to change the default thumbnail size.
                  • 26641
                  • 27 Posts
                  Hey David,

                  Thanks for checking.

                  Small world, eh?

                  Well, I’ll probably mess with it in a few hours or so. Again, thanks for looking.
                    • 26641
                    • 27 Posts
                    Never did figure this out.

                    I ended up writing my own snippets to do what I needed. It was simple enough, but still baffling why ditto wouldn’t work.