We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19889
    • 616 Posts
    hello
    I’ve a summary page with a navigation to the next/previous pages in the footer - when I e.g. click on the next, I’m getting an url like this for instance: domain.com/page.html?start=5

    is there a way to get the document id of the document shown? on the link domain.com/page.html?start=5 e.g. the document shown has id 54. I need to get this id in order to use it in a different snippet on that page.

    thank you in advance for your help.
      • 11187
      • 6 Posts
      I think that you can display the id of the shown document only inside the ditto output itself, as the page that shows ditto (and it’s id) stays the same, no matter the document you are viewing.
        • 4172
        • 5,888 Posts
        perhaps you can play around with something like that?

        <?php
        		$dittoID = '';
        		$start = $modx->getPlaceholder($dittoID."start");
        		$summarize = $modx->getPlaceholder($dittoID."perPage");
        		
        		$params['start']=$start+$summarize-1;
        		$params['display']='1';
        		$params['tpl']='@CODE:[+id+]';
        		//here go more Ditto-params (same as in your ditto-call parents,filter....)
        		$docid=$modx->runSnippet('Ditto',$params);
        		return $docid;
        		
        ?>
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!