I notice that getResources skips all documents with an empty content field using this tpl:
Title: [[+pagetitle]]<br />
I created a bunch of resources with just pagetitles to play with it and it took me a while to figure out why only a few of them were retrieved by getResources.
hmm... I tested it with:
[[getResources? &parents=`2`&tpl=`pagetitle`&limit=`999`&depth=`1`]]
and it shows all resources, also these with empty content.
But it showed me also childchilds (goes 2levels deep from parent), so I changed
$depth = !empty($depth) && ($depth = intval($depth)) ? $depth : 10;
to
$depth = !empty($depth) && ($depth = intval($depth)) ? $depth-1 : 10;
what seems to fix this issue
IMO, if I go one level deep (&depth=`1`) from parent I want to show only the direct childs, as it is in getChildIds or as it was in Ditto, too???
OK, I see what’s happening.
There are two issues:
1. I assumed that &limit=`0` would give me all of them, but it only gives five. I’m not sure what it should do, but probably not that.
What confused me is that putting any content in the content filed moves a document onto the list of five shown.
This must have to do with the sort order, but all the docs were published to begin with so saving them shouldn’t affect publishedOn, which is the stated default for sorting.
2. I looked in the DB and confirmed that saving a document updates both editedOn and publishedOn to the current timestamp (I’ll Jira that).