I see now why this can’t work; the $modx->documentMap maps all documents whether they are published or not. Since Ditto uses the documentMap to work out its own map, it will pass right through unpublished folders.
It appears that Ditto does not honor the seeThroughUnpub option; it will "see" through an unpublished folder in any case. Looking at the code, I tracked the value all the way to where the actual documents are retrieved, and I don’t see where it is used at all. In the getAllSubDocs function, it should be passed to the getChildIds function, where it would be used to determine whether to loop through a folder or not, depending on if it were published or not.
This discussion is closed to further replies. Keep calm and carry on.