modx - when I'm using "&documents=" parameter in ditto snippet, pagination doesn't work

436 views Asked by At

I'm trying run ditto with parameter which holds specific docIDs:

&documents=

when I put static IDs code to the chunk:

[[Ditto? &documents=`9,239,240,242,243,246,253,257,260,261,267,269,281,285,288` &showInMenuOnly=`1` &tpl=`item_subdocs`  &summarize=`2` &paginate=`1` &paginateAlwaysShowLinks=`1`  ]]
[+previous+][+pages+][+next+]

it works - pagination, link under the list - it's OK but when I'm trying to retrieve that IDs dynamically - by some snippet:

[[Ditto? &documents=`[[getIDs]]` &showInMenuOnly=`1` &tpl=`item_subdocs`  &summarize=`2` &paginate=`1` &paginateAlwaysShowLinks=`1`  ]]
[+previous+][+pages+][+next+]

It doesn't work. The pagination link will disappear, but when I run pages from URL by adding phrase:

?start=2

It's work... anyone knows what has happened?
Also running simple code from that snippet:

echo '9,239,240,242,243,246,253,257,260,261,267,269,281,285,288';

.. doesn't work

1

There are 1 answers

4
Sean Kimball On

try to get your snippet to output the values rather than just echoing them:

$output = '9,239,240,242,243,246,253,257,260,261,267,269,281,285,288';

return $output;

Sounds silly but modx can do weird things if snippet calls don't return something.