Totally untested, but you could try using the getPlaceholder() API call to build the pagination string. NB I've corrected the array value settings in your original post ("=" should be "=>")
<?php
$dittoOutput = $modx->runSnippet("Ditto",array(
'parents' => "4",
'tpl' => 'lista-tpl',
'sortBy'=>'pub_date',
'filter'=> $filter,
'paginate' => '1',
'paginateAlwaysShowLinks'=> '1',
'id' => 'onlycat'
)
);
$dittoOutput .= '<p>Showing <strong>' . $modx->getPlaceholder('start') . '</strong> - ';
$dittoOutput .= '<strong>' . $modx->getPlaceholder('stop') . '</strong> of ';
$dittoOutput .= '<strong>' . $modx->getPlaceholder('total') . '</strong> Articles | Page ';
$dittoOutput .= '<strong>' . $modx->getPlaceholder('currentPage') . '</strong> of ';
$dittoOutput .= '<strong>' . $modx->getPlaceholder('totalPages') . '</strong></p> ';
$dittoOutput .= '<div id="ditto_pages"> ' . $modx->getPlaceholder('previous');
$dittoOutput .= $modx->getPlaceholder('pages') . $modx->getPlaceholder('next') . '</div> </div>';
return $dittoOutput;
?>
I suspect there's a less long-winded way, as the document parser seems to refer to a collection of all the placeholders to implement getPlaceholder(). If that could be fetched as an array, you could use it with parseChunk() to make a more easily maintained way of forming the pagination links.
:) KP
Update: couldn't resist some experimenting, and found that
$modx->placeholders does indeed return an array of all the placeholders currently set. So you could set up your pagination code as a chunk with the normal placeholder names, and use $modx->parseChunk() with $modx->placeholders as the second parameter to form the string. Using this property of $modx is referred to in Mary's tutorial at
http://codingpad.maryspad.com/2010/01/15/modx-custom-snippet-api/.
===
[ed. note: kp52 last edited this post 14 years, 6 months ago.]