Я вот не понял как это сделать на чанках - какие писать в вызов дитто и что писать в самих чанках, чтобы добавить пробел? Сделал иначе:
1. Создал сниппет
SplitPagination, код взял
отсюда.
2. Написал вызод Дитто + Сплит:
[[Ditto? &language=`russian` &startID=`[*id*]` &summarize=`10` &hideFolders=`1` &paginate=1 &showInMenuOnly=`1` &tpl=`ditto_full` &dateFormat=`%Y.%m.%d` &depth=`0`]]
<div align=right>Показано <strong>[+start+]</strong> - <strong>[+stop+]</strong> из <strong>[+total+]</strong> документов.</div>
<center>[+previous+] [!SplitPagination? &return=`1` &lenght=`6`!] [+next+]</center>
3. Добавил пробелы в самом сниппете Сплит, получил:
<?php
// Snippet: splitPagination
// Must be placed immediately following a Ditto call
// Based on the function written by Aaron Hall, evilwalrus.org
if (!function_exists("generatePagination")) {
function generatePagination($curPage, $totResults, $resultsPerPage)
{
$totPages = ceil($totResults / $resultsPerPage);
$pagesBefore = $curPage - 1;
$pagesAfter = $totPages - $curPage;
$tabArr = array();
if($totPages > 15) {
if($pagesBefore > 7) {
$tabArr = array(1,2,0);
if($pagesAfter > 7)
{
for($i=($curPage-(4)); $i<$curPage; $i++) { $tabArr[] = $i; }
} else {
for($i=($totPages-11); $i<$curPage; $i++) { $tabArr[] = $i; }
}
} else {
for($i=1; $i<$curPage; $i++) { $tabArr[] = $i; }
}
$tabArr[] = $curPage;
if($pagesAfter > 7) {
if($pagesBefore > 7) {
for($i=($curPage+1); $i<=$curPage+4; $i++) { $tabArr[] = $i; }
} else {
for($i=($curPage+1); $i<13; $i++) { $tabArr[] = $i; }
}
$tabArr[] = 0;
$tabArr[] = $totPages-1;
$tabArr[] = $totPages;
} else {
for($i=($curPage+1); $i<=$totPages; $i++) { $tabArr[] = $i; }
}
} else {
for($i=1;$i<=$totPages;$i++) { $tabArr[] = $i; }
}
return $tabArr;
}
}
$id = isset($id) ? $id.'_' : '';
$total = isset($total) ? $total : $modx->getPlaceholder($id."total");
$start = isset($start) ? $start : $modx->getPlaceholder($id."start");
$display = isset($display) ? $display : $modx->getPlaceholder($id."perPage");
$currentPage = isset($currentPage) ? $currentPage : $modx->getPlaceholder($id."current");
$landing = isset($tagDocumentID) ? $tagDocumentID : $modx->documentObject['id'];
if ($total == 0 || $display==0) {
return false;
}
$page = ceil($start/$display);
$return = isset($return) ? $return : 0;
$paginationArray = generatePagination($page, $total, $display);
$ph = "";
$cInc = $_GET[$id.'start'];
foreach($paginationArray as $page) {
$inc = ($page-1)*$display;
if($page == 0) {
$ph .= "..."; // print an elipse, representing pages that aren't displayed
} else if ($inc==$cInc) {
$ph .= "<span class=\"ditto_currentpage\">[$page] </span>";
} else {
$ph .= "<a class=\"ditto_page\" href='".ditto::buildURL("start=".$inc,$landing,$id)."'>$page</a> ";
}
}
$modx->setPlaceholder($id."splitPages",$ph);
if ($return) return $ph;
?>
?>
4. Если интересно (в качестве примера), в чанке
ditto_full у меня:
<h3><a href="[~[+id+]~]" title="[+longtitle+]">[+title+]</a></h3>
[+introtext+] <a href="[~[+id+]~]" title="[+longtitle+]">Показать полную версию.</a><br />
<div align=rigth>Добавил(а) [+author+], [+date+].</div><br /><br />