Would you mind sharing your solution for the pagination for others who might come across this topic some day?
As for your question.. Anything’s possible. That last question is slightly more difficult than basic pagination though
As you’ve been messing around with plugins and htaccess I take it you don’t mind diving into some PHP/MODX/xPDO...
You could start with something like this:
$current = $modx->resource;
$cid = $modx->resource->get('id');
$parent = $current->getOne('Parent');
$children = $parent->getMany('Children');
$last = ''; $cur = ''; $next = ''; $gotit = 0;
foreach ($children as $child) {
if ($gotit == 1) {
$next == $child->get('id');
return json_encode(array($last,$next));
}
$last = $cur;
$cur = $child->get('id');
if ($cur == $cid) {
$gotit = 1;
}
}
I hope that makes sense. You first get the parent to get all children (perhaps there’s also a sibblings class, not sure about that atm), then loop through all children while saving the last one and comparing the ID of the child you’re looking at with the ID of the current resource. If you got a match, you still need one more time to find the next link and then break out of the foreach() or return something which you can then use to build the data.
Just an idea - there’s probably a better way (or existing addon) than this one.