We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36582
    • 463 Posts
    First of all many thanks to you guys for pointing me in the right direction time after time - my testing is going extremely well - I’m very optimistic and very impressed.

    How can I paginate the results in Ditto so that only a certain number of results are returned per page and I can use the ’previous’ and ’next’ options?

    Thanks again
      Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
      • 18397
      • 3,250 Posts
      Assuming you are using Ditto 2:

      &summarize = number of results per page
      &paginate = 1
      &paginateAlwaysShowLinks= 1

      Then add this after the Ditto call:

      <p>Showing <strong>[+start+]</strong> - <strong>[+stop+]</strong> of <strong>[+total+]</strong> Articles | Page <strong>[+currentPage+]</strong> of <strong>[+totalPages+]</strong></p> <div id="ditto_pages"> [+previous+] [+pages+] [+next+] </div> </div>
      


      And here is some example CSS to get you started:
      .ditto_paging {
          border-top: 1px solid #ccc;
          padding: 10px; 
          font-size: 86%;
          color: black;
      }
      #ditto_pages .ditto_currentpage {
          border: 1px solid black;
          padding: 1px 5px 2px; 
          margin-right: 1px;
          background-color: #008CBA; 
          color: #fff;
      } 
      #ditto_pages .ditto_off {
          border: 1px solid #ccc;
          padding: 1px 5px 2px; 
          margin-right: 1px;
          color: #ccc;
      }
      #ditto_pages a, #ditto_pages a:link, #ditto_pages a:visited {
          border: 1px solid #008CBA; 
          padding: 1px 5px 2px; 
          margin-right: 1px; 
          text-decoration: none !important; 
          color: black;
      } 
      #ditto_pages a:hover {
          background-color: #fff;
          color: #000;
      }
      


      Updated: Added example CSS.
        • 36582
        • 463 Posts
        Thank you - worked a treat
          Web site design in Nottingham UK by Chris Fickling http://www.chrisficklingdesign.co.uk
          • 33114
          • 518 Posts
          I’d like to know how to use pagination with multiple ditto calls on a page. And how the "id" parameter deals with [+pages+] placeholder.
          In this call
          [!Ditto? &id=`blog` &startID=`39,40,80` &tpl=`ditto_news` &sortBy=`createdon` &summarize=`7` &dateFormat=`%d.%m.%Y` &truncText=`далее...` &paginate=`1`!]
          <div id="pagination"><span>Стр.:</span> [+pages+]</div>

          no pages are displayed.

          [Solved] When you set the "id" parameter, you should prefix the corresponding pagination placeholder with that id.
          Example: [[Ditto? ... &id=`main` ...]]
          [+main_pages+]
            http://modx.ru - российская поддержка MODx
            http://newscup.ru - экспериментальный проект
            http://yentsun.com - персональный сайт
            • 26085
            • 494 Posts
            Quote from: yentsun at Apr 14, 2007, 09:51 PM

            I’d like to know how to use pagination with multiple ditto calls on a page. And how the "id" parameter deals with [+pages+] placeholder.
            In this call
            [!Ditto? &id=`blog` &startID=`39,40,80` &tpl=`ditto_news` &sortBy=`createdon` &summarize=`7` &dateFormat=`%d.%m.%Y` &truncText=`далее...` &paginate=`1`!]
            <div id="pagination"><span>Стр.:</span> [+pages+]</div>

            no pages are displayed.

            [Solved] When you set the "id" parameter, you should prefix the corresponding pagination placeholder with that id.
            Example: [[Ditto? ... &id=`main` ...]]
            [+main_pages+]

            I think that I have tha same problem http://modxcms.com/forums/index.php/topic,14972.0.html
            That should I do to use two ditto calls without problems?
            Thanks I understood how to use it.
              • 26085
              • 494 Posts
              Paginate does not with PHX.
              I don’t see pages.
                • 18397
                • 3,250 Posts
                There is a known workaround for this.
                  • 26085
                  • 494 Posts
                  Quote from: Mark at Jun 07, 2007, 06:05 AM

                  There is a known workaround for this.
                  Thanks
                    • 12306
                    • 16 Posts
                    Is there a way to use Ditto pagination on a site with Friendly URLs? I have been unable to get this to work so far.
                    Thanks in advance!
                    Tom
                      • 18397
                      • 3,250 Posts
                      Ditto pagination should work fine with Friendly URLs out of the box. What sort of issue are you experiencing?