Basically, getResources (or pdoResources), gets each resource, then creates an associative array of the key/value pairs for all the resource fields (pagetitle, longtitle, menutitle, publishedon, content, etc., then adds all the resources TV's to that array with the name of the TV as the key and it's value for the currently plucked resource as the value).
Then, it calls $modx->getChunk('YourTplChunk', $fields), where $fields is the associative array. getChunk() returns the Tpl chunk with all the placeholders replaced with the values from the associative array.
As each resource is processed, getResources appends the return from getChunk() to the output.
When the loop is finished, it returns that output.
The Tpl chunk is nothing more than the HTML you want for each item to be displayed with the placeholders embedded in the HTML.
The easiest way to understand it is to just do this to start with (replace 12 with some appropriate parent resource ID that has some children):
<ul>
[[!getResources?
&parents=`12`
&tpl=`MyTpl`
&includeTVs=`1`
&tvPrefix=``
]]
</ul>
Then create a chunk called MyTpl with this content:
Once that works to list the pagetitles, extend it like this:
<li>[[+pagetitle]] <a href="[[~[[+id]] ]]">See more ... </a></li>
Just keep editing the Tpl chunk until the results look like you want them to. Tags for the TVs look just like the ones for the resource fields -- but with the name of the TV in the tag.
I hope that makes sense.
Here's a full list of the
resource fields.
The date fields are a little tricky, but let's save that for later.