We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7527
    • 437 Posts
    Hi,

    I am having issues getting Ditto pagination working. I am using Evo 1.0.15 and Ditto 2.1.1. I have a container id (4) and I have set a ditto call to show 2 articles at a time on the page, I have used the &tpl parameter with the following code:

    <h3><a href="[~[+id+]~]">[+pagetitle+]</a></h3>
    [+introtext+]
    <a href="[+url+]"> read more...</a>


    My call on ID 4 is
    [!Ditto? &parents=`4` &tpl=`legoBlog` &display=`2` &paginate=`1` &paginateAlwaysShowLinks=`0`!]
    
    [+previous+] [+pages+] [+next+]


    I have 3 child resources in container ID 4, so my page should show sumamry and pagetitle of the first two, and then show pagination to navigate to the next. Everything shows fine, except the pagination. Am I missing something?

    Any help appreciated
    Regards
    SB

    This question has been answered by iusemodx. See the first response.

      www.PawsForWildlife.co.uk
      www.Borntobrick.co.uk
      • 13226
      • 953 Posts
      At a guess: Your page where the paginated navigation is, is the overview, like a blog post overview list

      You are calling Ditto uncached, is the page cached or uncached ?

      Try changing your page to be uncached and the Ditto call cached

      [[Ditto? &parents=`4` &tpl=`legoBlog` &display=`2` &paginate=`1` &paginateAlwaysShowLinks=`0`]]
        • 13226
        • 953 Posts
        When using paginate:

        Use &total to limit the number of documents retrieved.

        [[Ditto? &parents=`[*id*]` &tpl=`legoBlog` &total=`2` &paginate=`1` &paginateAlwaysShowLinks=`0` &showInMenuOnly=`0` &showPublishedOnly=`1`]]

        Ditto parameters
          • 7527
          • 437 Posts
          Hi,

          I have everything you mentioned but still nothing. Yes it is a blog post overview page. The titles and summary show up but the pagination is still missing from the bottom?
            www.PawsForWildlife.co.uk
            www.Borntobrick.co.uk
            • 13226
            • 953 Posts
            You have an error in your tpl href:

            This:
            <a href="[+url+]">read more...</a>

            Should be this:
            <a href="[~[+id+]~]">read more…</a>
              • 7527
              • 437 Posts
              Have now amended thank you. Still no pagination, I have used the same in the past and got it working, just can't remember how?
                www.PawsForWildlife.co.uk
                www.Borntobrick.co.uk
                • 13226
                • 953 Posts
                if the page is set to be not cacheable and the call is cached it should by rights work.

                Try using this call:
                [[Ditto? &parents=`[*id*]` &tpl=`legoBlog` &total=`2` &paginate=`1` &paginateAlwaysShowLinks=`0` &showInMenuOnly=`0` &showPublishedOnly=`1`]]
                [+previous+] [+pages+] [+next+]
                  • 7527
                  • 437 Posts
                  Ok that shows a 1 under my results, but nothing else
                    www.PawsForWildlife.co.uk
                    www.Borntobrick.co.uk
                  • discuss.answer
                    • 13226
                    • 953 Posts
                    OK:

                    This works 100% - I have it working in front of me at this very moment:

                    [[Ditto? &parents=`[*id*]` &display=`2` &paginate=`1` &paginateAlwaysShowLinks=`0` &showInMenuOnly=`0` &showPublishedOnly=`1`]]
                    [+previous+] [+pages+] [+next+]


                    Ensure that the page id 4 is set to uncached in the settings tab - remove the tick from "Cacheable" and save

                    Note: I haven't added your tpl so you will have to add that back into the call, or simply leave it out for testing
                      • 7527
                      • 437 Posts
                      Not sure what was going wrong but all is working fine now, maybe I had a misspelling somewhere? Thank you for the help
                      Regards, SB
                        www.PawsForWildlife.co.uk
                        www.Borntobrick.co.uk