0

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

quardas
  • 651
  • 3
  • 10
  • 23

1 Answers1

1

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.

Sean Kimball
  • 4,506
  • 9
  • 42
  • 73
  • I was trying to do it like that, but sorry - nope.. It still doesn't work. Although, thanks for that reply! – quardas May 21 '12 at 18:04
  • What happens if you try to put your ids in a chunk rather than a snippet? – Sean Kimball May 21 '12 at 19:38
  • Yes. When Im passing that list of IDs in the chunk statically - paginate working, but when Im trying in the snippet - not. Strange, but echoing the same code like in chunk - in the snippet - doesn't working too. – quardas May 22 '12 at 10:45
  • I described this problem here and found the solution http://forums.modx.com/thread/76718/ditto-documents-pagination---strange-problem – quardas May 23 '12 at 09:58