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.
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.
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;
?>