Hello
I’m using ditto on a folder page to show the latest entry in that folder.
the child document contains a call to a snippet that lists some images from the server - the call looks like this:
$id = isset($id) ? $id : $modx->documentIdentifier;
$folder = 'assets/site/images/properties/'.'p'.$id.'/';
each child document has it’s own folder on the server - so for instance document 24 has a folder like this: ’p24’;
When looking at the page on the folder page (id 23), the call fails since the call to the snippet is executed with the id of the parent document (23) instead of the child page id which is 24 that would result in listing the images in the p24 folder on the server.
Does anybody have an idea how to solve this?
Thank you in advance for your help.
maybe I’m a little closer - this is what I have:
if ($modx->documentObject['isfolder']) {
return '[+id+]';
}else{
$id = $modx->documentIdentifier;
}
the isfolder part returns the correct id of the child document - however I’m unable to do something like this: