We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7860
    • 7 Posts
    [[Ditto? &parents=`15` &sortBy=`myDate` &tpl=`gallery-page` &summarize=`6` &paginate=`1` &paginateAlwaysShowLinks=`1` ]]
    


    The code above was working on my local setup. But when I exported it to the current site, the pagination did not work all of a sudden.

    The scenario:
    6 items per page, 3 pages
    when i click on other pages, it returns the same page.

    I have tried different solutions (with regard to caching) from search results here, to no avail.

    Can you help me identify the problem? Is it a modx issue or probably a webhosting issue? I will appreciate any help.

    Another thing, it seems that the search function also caches on the server, and everytime i do a search, the same results page are being fetched.




      • 18397
      • 3,250 Posts
      1. Can you please post your pagination placeholders?
      2. Did you try a [!Ditto!] style call?
      3. Is the page cacheable?
        • 19755
        • 23 Posts
        Thanks, if page is cacheable, pagination don’t work!
          • 29201
          • 239 Posts
          I've got an uncached page ( http://cl.ly/0s3K1W0p2J0C1k2i2i3A ) and I'm calling ditto as follows:

          [!Ditto? &id=`wp` &parents=`5` &orderBy=`createdon DESC` &summarize=`3` &paginate=`1` &paginateAlwaysShowLinks=`1` &dateFormat=`%A, %B %e, %Y` &tpl=`blog_tpl` &extenders=`dateFilter` &tagData=`keywords` &tagDelimiter=`,` &tagDocumentID=`858`!]

          <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>

          ....and still no pagination?!
            • 36592
            • 970 Posts
            If you use &id parameter, youhave to add it to your placeholder like this...
            [+wp_start+]
            • Generally when I have a Ditto issue it means I have used the ditto call in a rich text editor field and I need to either put the call in a a chunk with no RTE and then rop it back into the content box and change all & to & or I have somehow screwed up the ` and put in a ' instead out of sheer habit.

              the other thing to troubleshoot and check is the cached/uncached status (if the page is cached, the call must be uncached)

              and I always use this as a reference.
              http://www.pogwatch.com/ditto/ditto-pagination.html

              the id is the id of the Ditto call on the page, it means you have more than one Ditto instance on the page and need to reference that one.

                ________

                Anne
                Toad-in-Chief
                Red Toad Media - Web Design, Louisville KY
                Hear me tweet: http://www.twitter.com/redtoadmedia
                "Bring on the imperialistic condiments." - Rory Gilmore
                • 23610
                • 37 Posts
                Pagination will work with cached page if you put Ditto call into snippet like this:
                <?php
                // snippet name: run_my_ditto
                $params['parents']='2';
                $params['display']='10';
                $params['tpl']='myDittoTplChunk';
                $params['tplPaginatePage']='@CODE: <a href="[+url+]">[+page+]</a> ';
                $params['paginate']='1';
                $params['paginateAlwaysShowLinks']='1';
                $output = $modx->runSnippet('Ditto',$params);
                // add pagination to output
                $output .= 'Total: [+total+], Page: [+pages+]';
                return $output;
                ?>
                
                Snippet above should be uncached [!run_my_ditto!]
                This allow us to have cached document with uncached Ditto call with pagination.