We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6433
    • 25 Posts
    I have a similar pagination issue, but using tags. The call:
    [!Ditto? &paginate=`1` &display=`10` &tpl=`resource_list_tpl` &tagData=`resource_tags` &tagDelimiter=`, ` &tagDocumentID=`21` &parents=`10` &orderBy=`pagetitle` &sortDir=`ASC` &depth=`5` !]

    The prev and next links appear correctly, but the url is still encoded - so for NEXT it spits out:
    mysite.com/resources/resources-tags.html?tags=These Tags&start=10

    *note the "&" rather than &.

    As such, the page loads but ignores the all-important start directive. Any ideas?
      • 74
      • 74 Posts
      I call Ditto from my snippet by $modx->runSnippet, $modx->setPlaceholder with some pagination params.
      Ditto pagination paceholders, like [+currentPage+], [+totalPages+], [+next+] shows correctly only on 1th results page.
      By clicking on any other pagenumber i get 0 pages and 0 results.
      Any ideas about $modx->runSnippet and pagination?
        • 7231
        • 4,205 Posts
        Any ideas about $modx->runSnippet and pagination?
        I use it all of the time, it works. How does $modx->setPlaceholder fit into the equation?
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don't know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 74
          • 74 Posts
          Dev_cw, thanks for fast replay.
          1. Ditto call from my snippet (form_check) :
          $D=$modx->runSnippet('Ditto', array( 'startID'=>'54','depth'=>'3', 'hideFolders'=>'1', 'paginate'=>'1', 'summarize'=>'5', 'paginateAlwaysShowLinks'=>'1', 'filter'=>$Filtr_string)); 
          $modx->setPlaceholder('ditto_call',$D); 
          $pages = '<p>Show <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> --';
          $modx->setPlaceholder('search_rezult',$pages);

          2. In Search results page:
          [!form_check!] 
          [+ditto_call+]
          [+search_rezult+]

          It shows pagenumbers, next-previous links etc.
          But pagination don`t works.
          What`s wrong?
            • 2603
            • 104 Posts
            Hi guys!

            A little problem with paginate.
            On one document (7) paginate call works correct, but on the other (1) It shown and active but doesnt work. The page is going to itself.
            Ofcourse I have changed parents.

            [[Ditto? &parents=`7` &tpl=`radio` &orderBy=`pub_date DESC` &hiddenFields=`author` &display=`3` &paginate=`1` &paginateAlwaysShowLinks=`1` extenders=`summary,dateFilter`]]



            SOLVED:
            I have fogot to switch off cashing of page. When I’ve don, everything is ok. smiley
              Getting higher! | www.djabuzz.com
              • 1978
              • 131 Posts
              call it [!Ditto!] and don’t switch page caching off
                Как русифировать Modx 0.9.6.1(QuickEdit, TinyMCE)
                QuickEdit под win-1251 без mb_-функций
                • 4831
                • 57 Posts
                Hi everyone,
                I’m trying to reduce the number of links displayed by pagination function. Is there a simple way to do that ?
                I would like to reproduce the google "result page" script (previous1234 next) and after clicking the "2" link appear "previous 2345 next"....
                Is it possible to do that with a special parameter in Ditto, is it possible with Phx, or I need to write a javascript ? (...thing that I don’t know how to do)
                  • 29676
                  • 45 Posts
                  Trying to add pagination to http://80.247.1.230/blog.html

                  The page ’show_blog’ calls the Ditto Snippet by:

                  [!Ditto? &parents=`2` &summarize=`5` &paginate=’1’ &paginateAlwaysShowLinks= ’1’ &total=`2` &tpl=`nl_blog` &tpl=`BlogPageTemplate’ &dateFormat=`%d %b %Y`!]

                  The layout is controlled by: BlogPageTemplate chunk which looks like:

                  <div class="ditto_item" id="ditto_item_[+id+]">
                  <h3 class="ditto_pageTitle"><a href="[~[+id+]~]">[+pagetitle+]</a></h3>
                  <div class="ditto_documentInfo">by <strong>[+author+]</strong> on [+date+]</div> <div class="ditto_introText">[+introtext+]</div>
                  </div>

                  Which results in a summary page of recent blogs

                  BUT - how and where do I add the pagination bits mentioned at the top of this post and how do I limit the no of posts on the page to (say) 5 .. at the moment no matter what I do, the limit is 10.

                  Thanks
                    • 4310
                    • 2,310 Posts
                    Try adding underneath your Ditto call something like :
                    <p>Showing <strong>[+start+]</strong> - <strong>[+stop+]</strong> of <strong>[+total+]</strong> Results | Page <strong>[+currentPage+]</strong> of <strong>[+totalPages+]</strong> </p> <div id="ditto_pages"> [+previous+] [+pages+] [+next+] </div> 


                    You might need to add &display=`4` where 4 is the number of summaries per paginated page.
                      • 29676
                      • 45 Posts
                      Do you mean directly after

                      [!Ditto? &parents=`2` &summarize=`5` &paginate=’1’ &paginateAlwaysShowLinks= ’1’ &total=`2` &tpl=`nl_blog` &tpl=`BlogPageTemplate’ &dateFormat=`%d %b %Y`!]

                      Apologies for being dumb - but I find MOSx great for basic stuff but snippets etc get me confused sad

                      Thanks