Была схожая задача. У меня просто выводились ссылки на соседние элементы. типа:
← Кухня «Виола» | Кухня «Волна 2» →
Картинки, думаю, сам доделаешь.
Для Evo использовал сниппет:
[[PrevNext]]
<?php
$ID = $modx->documentIdentifier;
$parentId = array_pop($modx->getParentIds($modx->documentIdentifier,1));
$children = $modx->getActiveChildren($parentId,'menuindex','ASC');
$i=0;
$key = false;
while(!$key && $i<count($children)){
$key = array_search($ID,$children[$i]);
$i++;
}
if(!empty($key) && count($children)>1)
{
if ($i-2>=0) { $pprev = $modx->getDocument($children[$i-2]['id'], "pagetitle"); }
if ($i<count($children)) { $pnext = $modx->getDocument($children[$i]['id'], "pagetitle"); }
$placeholders = array(
'prev'=>( $i-2>=0 ? '<a href="'.$modx->makeUrl($children[$i-2]['id']).'">← '.$pprev['pagetitle'].'</a>':''),
'next'=>($i<count($children)?'<a href="'.$modx->makeUrl($children[$i]['id']).'">'.$pnext['pagetitle'].' →</a>':'')
);
$output = $modx->parseChunk('prevnext',$placeholders,'[+', '+]');
}
return $output;
?>
Чанк
prevnext:
Чанк
next
<a href="[~[+id+]~]">[+pagetitle+] →</a>
Чанк
prev
<a href="[~[+id+]~]">← [+pagetitle+]</a>