We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36592
    • 970 Posts
    If you use &id parameter in your Ditto call ( &id=`catlist2` ), you have to add id prefix to your pagination placeholders, like... [+catlist2_start+].
      • 15871
      • 105 Posts
      Yes I did that. I had the ID set, and it didn’t work. I also tried removing the ID but that didn’t work either. I am wondering if it’s an issue with the snippet running the Ditto call, instead of the Ditto call being placed on the page traditionally. Is it possible there is a runtime issue and the pagination placeholders aren;t being displayed because they can’t see the Ditto call at the time the document is rendered?
        • 15871
        • 105 Posts
        I got it working. With some modifications to the code Bruno17 posted:

        <?php
        $children = (isset($parent))?$modx->getChildIds($parent,$depth=0):array();	
        $documents = (isset($documents))?explode(',',$documents):array();
        $documents=array_merge($children,$documents);
        $params=array();
        $params['documents']=implode(',',$documents);
        //$params['id']='catlist';
        $params['tpl']='tpl.category';
        if($_GET['all']==1){
        }
        else{
        $params['paginate']=1;
        $params['display']=8;
        }
        //$params['paginateAlwaysShowLinks']=1;
        //$params['extenders']='request';
        //$params['phx']='1';
        $params['sortDir']='ASC';
        $params['sortBy']='menuindex';
        //$params['debug']=1;
        
        $output=$modx->runSnippet('Ditto',$params);
        
        print '<ul class="list">'.$output.'</ul>';
        print '<div id="ditto_pages">[+previous+] [+pages+] [+next+]<a href="[~[*id*]~]?all=1" class="ditto_catlist_next_link">SEE ALL</a> </div>';
        ?>