In detail, hopefully understandably
<a name='nieuws'></a>
[[Ditto? &id=`nieuwsarchief` &tpl=`paginaSamenvatting` &display=`5` &orderBy=`pub_date DESC` &showInMenuOnly=`1` &paginate=`1` &tplPaginatePrevious=`ditto_vorige` &tplPaginateNext=`ditto_volgende` &tplPaginatePage=`ditto_pagina` &extenders=`summary` &truncText=`lees verder...` &noResults=`Geen nieuws bekend`]]
Berichten [+nieuwsarchief_start+] t/m [+nieuwsarchief_stop+] van [+nieuwsarchief_total+] ‖ Pagina [+nieuwsarchief_currentPage+] van [+nieuwsarchief_totalPages+] ‖ [+nieuwsarchief_previous+] [+nieuwsarchief_pages+] [+nieuwsarchief_next+]
I have pagination, so the Ditto call is uncached. I have another (uncached) Ditto call, so for pagination to work, I’ve added an &id=`` to the paginated Ditto call (‘nieuwsarchief’). The placeholders for pagination therefore have this ID in the placeholder name (so that it works for that particular Ditto call). If you have only one Ditto call on the page the id parameter is not neccisary, and instead of [+nieuwsarchief_next+], just use [+next+]...
Then turn pagination on with &pagination=`1`, and add &tplPaginatePrevious=``, &tplPaginateNext=`` and &tplPaginatePage=`` to use chunks as a template for the pagination links (so fill them with the name of your chunks, otherwise I think the links will not show at all!).
For these three parameters, make 3 separate chunks, I have:
Chunk: ditto_vorige
<a href='[+url+]#nieuws'>Vorige</a>
Chunk: ditto_volgende
<a href='[+url+]#nieuws'>Volgende</a>
Chunk: ditto_pagina
<a href='[+url+]#nieuws'>[+page+]</a>
Of course you can name the chunks and the ditto call ID anything you would like…. Mine are in Dutch so….
In the chunks, I’ve added the name of the anchor (<a name="nieuws"></a>) I’ve placed at the top of the Ditto call, to the links in the chunk.
Now instead of the default template for the paginations links, it will use your new chunks, with the anchor added named ’nieuws’ in my case…. (name of anchor you can change also of course).
I’m using the ’nieuws’ anchor for all my paginated ditto calls, but if you want to use two different ditto calls on 1 page, you’ll need to make a different set of chunks with a different anchor(name).
Nice overview of Ditto parameters:
http://ditto.modxcms.com/files/snippet-ditto-php.html
and of pagination:
http://ditto.modxcms.com/tutorials/pagination.html