&parents=`26`&tpl=`commadelimeted` &hideFolders=`1` &filter=`type,reference,9` &display=`10` &randomize=`1`
gets 10 random resources with parent=26 and isfolder=0 and filters unwanted resources out and orders them randomized.
so far I know you cannot use orderBy at same time.
but you can order them in the second call and output them with your template and so on.
I think this should work.
was it random output from all and then ordered as needed?
Then it did work. But only once.
perhaps you have to make the resource uncached.
try it as one snippet:
<?php
//[!runditto!]
$params['parents']='26';
$params['tpl']='@CODE:[+id+],';
$params['hideFolders']='1';
$params['filter']='type,reference,9';
$params['display']='10';
$params['randomize']='1';
$documents=$modx->runSnippet('Ditto',$params);
$params=array();
$params['id']='dt3';
$params['documents']=$documents;
$params['tpl']='tpl-LinkListing';
$params['orderBy']='longtitle ASC';
$params['language']='german';
return $modx->runSnippet('Ditto',$params);
?>
you created a snippet with this code and named it ’runditto’.
then you putted [!runditto!] on your template?
And its output is nothing?
I’m using an empty template to test and I put the snippet call into a new document.
and when you add
<?php
//[!runditto!]
return 'the snippet runs';
into the snippet-code.
empty template
without [*content*] ?