We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36760
    • 136 Posts
    That did the trick.

    And thanks for the info about hyphens, I'll leave them out just to be safe.
      • 36760
      • 136 Posts
      One more question. If I wanted to use an image for the Prev/Next buttons, what's the correct way to go about doing it? I've tried the method below, with no luck. It still shows the default text. I know there's a language placeholder, would I have to do something special with that?

      Ditto Call
      [[Ditto? &id=`printgallery` &tpl=`print_gallery_tpl` &sortBy=`menuindex` &sortDir=`ASC` &paginate=`1` &display=`8` &paginateAlwaysShowLinks=`1` &tplPaginateNext=`print_gallery_next_btn` &tplPaginatePrevious=`print_gallery_prev_btn`]]


      Chunk for the Previous button template
      <a href='[+url+]' class='ditto_next_link'><img src="[(site_url)]/images/print-gallery-prev-btn.png" width="26" height-"64" alt="Previous" /></a>


      Also, is there a new home for www.ditto.modxcms.com? I notice that's mentioned in a lot of threads I've read, but it not longer exists. I have a feeling it may help me with a lot of my questions.

      Thanks!
        • 16278
        • 928 Posts
        Using the &tplPaginatePrevious etc. tpl chunks works for me, but you do need to define what shows when you're on the first or last pages (so no link), using &tplPaginatePreviousOff and &tplPaginateNextOff. Using these parameters means there's no need to mess with the language file, which supplies the default texts.

        I've covered most of the basic usage of Ditto, with examples, on the Pogwatch site, drawing on the original offical documentation and Bill Fernandez's guide to a slightly earlier version of Ditto than the current one. I also happen to have downloaded the Ditto site itself for reference on the more obscure points. It works OK as a local version, though many of the images are missing. I will post it separately, as this is not the first time the server has gone AWOL.

        :) KP
          • 36760
          • 136 Posts
          Thanks again.

          One more question, since I have your attention! smiley

          Is it possible to have two separate next/previous templates in the same Ditto call? Say, one that uses the arrow images, and then another for a set that just has the Previous/Next text.

          If that makes sense.
            • 16278
            • 928 Posts
            Alongside each other, or as alternatives? Either way, I suppose you'd do it in a single tpl chunk, with straight HTML for the former, or using PHx to switch on whatever the conditional would be for the latter.
            :) KP
              • 38226
              • 18 Posts
              I am having similar trouble getting the pagination to work. Below is my Ditto call and placeholder for the pagination links.

                                       
              [!Ditto? &id=`blog` &parents=`26` &filter=`id,34,2|id,35,2||id,36,2||id,37,2||id,38,2||id,39,2` &extenders=`summary` &tpl=`blogExcerpt` &sortBy=`pub_date` &sortDir=`DESC` &display=`10` &paginate=`1` &paginateAlwaysShowLinks=`1` &truncLen=`400` &truncOffset=`20` &truncText=`Continue Reading` &dateSource=`pub_date` &dateFormat=`%B %e, %Y`!]
                                                                     
              <div id="pageNav">[+blog_previous+] [+blog_pages+] [+blog_next+]</div>
              


              Any insights would be so appreciated!
              thx ~ Jules
                • 16278
                • 928 Posts
                Do you use the PHx plugin? If so, you need to call Ditto uncached, and make the page non-cacheable for pagination to work.
                :) KP
                  • 19369
                  • 1,098 Posts
                  There is a solution that allows you to keep the page cached, see this snippet:
                  https://forums.modx.com/thread/42253/ditto-with-pagination-on-cashed-page#dis-post-244847
                    • 38226
                    • 18 Posts
                    Quote from: kp52 at May 05, 2012, 11:55 AM
                    Do you use the PHx plugin? If so, you need to call Ditto uncached, and make the page non-cacheable for pagination to work.
                    :) KP

                    Yes I am using the PHx plugin, so I updated my Ditto call to be uncached and the pagination links are now showing correctly. Unfortunately they're not working correctly.

                    I currently have 12 posts. using &display=`10` the 10 most current posts show and the next link takes me to: mysite.com/blog?blog_start=10
                    BUT when I click on the link I get the same 10 posts showing up.
                    Any ideas on this?


                    @microcipcip - thanks for the link.

                    THANK YOU for the responses you guys!
                    Jules
                      • 19369
                      • 1,098 Posts
                      Quote from: juleswebb at May 05, 2012, 07:48 PM
                      Yes I am using the PHx plugin, so I updated my Ditto call to be uncached and the pagination links are now showing correctly. Unfortunately they're not working correctly.
                      .....
                      Any ideas on this?
                      Yes, you need to make the whole page uncached, not just Ditto Call. That's why I linked you an alternative solution where you don't need to make the page uncached.