) need(s) to know the ID of the Ditto document.$modx->documentIdentifier;
To do this I (i.e. the snippet) need(s) to know the ID of the Ditto document.
$modx->documentIdentifier;
in the Snippet returns the ID of the current document, not that of a document called by Ditto.
[!YourSnippet? &docid=`[+id+]`!]