ok, just tested what i said before and it works.. well you need to adjust a bit
this one grab 2 doc in parent 33 and then randomize :
[!Ditto? &documents=`[[Ditto? &parents=`33` &total=`2` &tpl=`justId` &tplLast=`justIdLast`]]` &randomize=`1`!]
Please note: [!...[[...]]....!]
And you need to output ids like this "1,2,3,4,5,6" so a tpl with just "[+id+]," is not enough. you need to make another tpl for
the last element with
&tplLast (in our case "[+id+]" without the ",").
if you dont want to use a chunk for only the Id, you normally can do that
&tpl=`@CODE:[+id+],` &tplLast=`@CODE:[+id+]`
(in my tests this broke the sql queries.. weird.. but should work!
more: bruno made a simple but effective examples who
run ditto with $modx->runSnippet(’Ditto’,$params);.