sottwell, thank you. You got me thinking.
I thought I had nested chunks before, but it was because I was using Ditto that it didn’t work.
I’ll use your example because it is easier to understand. ChunkA didn’t have any placeholders so I got this error because it was Ditto calling the chunk:
’&tpl either does not contain any placeholders or is an invalid chunk name, code block, or filename. Please check it.’
So to fix it I just put this in ChunkA to satisfy Ditto looking for placeholders.
<!--
By <strong>[+author+]</strong>
on [+date+].
-->
Now I have one chunk that outputs the post ChunkB (BlogTemplate), and another chunk ChunkA (BlogTemplate_All_Posts_But_Last_One) that outputs ChunkB then outputs a divider for every post except the last one.
Here is my Ditto call.
[!Ditto? &parents=`5` &display=`10` &total=`12` &commentsChunk=`CommentsBlog` &tpl=`BlogTemplate_All_Posts_But_Last_One` &tplLast=`BlogTemplate`!]
The reason I did it this way is because I wanted to only edit one chunk, if I wanted to change how the posts were displayed. Instead of having to edit multiple chunks with similar code in each.
Related posts/questions that got me to my final answer.
http://ditto.modxcms.com/files/snippet-ditto-php.html#tpl
http://ditto.modxcms.com/files/snippet-ditto-php.html#tplLast
http://modxcms.com/forums/index.php/topic,54299.msg313534.html#msg313534