discuss.answer
This should work. Are you sure, your resources have different menuindex - values?
Does sorting by menuindex work with getResources or pdoResources?
Bruno17, I take my hat off to you. You are right. Although the blog post child resources have a menuindex, the other child resources that my homemade snippet is trying to order apparently do not. How is that possible? Do you know how I can somehow "switch" the menuindex on for those child resources?
In the past when I had another problem with sortby menuindex not working, I went to Settings and changed change context_tree_sortby from "rank" (which it was by default) to "key". I have already done that for this site.
Okay. Sorted. Dragging and dropping the child resources a few times seems to have jigged the system into operation and now the menuindex figures have all (bar one) moved away from 0. The code above now works as you said it should.
Thank you.