I needed to build a site that aggregates different resources into one page. So it can be scrolled by anchors.
The problem was to assign an individual Chunk-Template to every resource.
For this purpose I tweaked the getResources-Snippet.
1. Copy the getResources-Snippet (ver. 1.6.0) to getResourcesAltTpl (or any other name you wish)
2. Open the newly created Snippet and add the following code:
2a. around line 98 (default properties):
$tplAltTV = !empty($tplAltTV) ? $tplAltTV : '';
2b. after line 575:
$tplAltTVx = $properties[$tvPrefix . $tplAltTV];
if (!empty($tplAltTV) && empty($resourceTpl)) {
$resourceTpl = parseTpl($tplAltTVx,$properties);
}
just before:
if (!empty($tpl) && empty($resourceTpl)) {
3. Create a TV (type listbox). You can automatically populate it with the names of the chunks you need with
@SELECT name FROM modx_site_htmlsnippets WHERE category = (number of the category you ordered your chunks)
4. Assign a chunk template to every resource via TV
5. Use the new Snippet as follwing:
[[!getResourcesAltTpl?
&includeContent=`1`
&parents=`[[*parent]]`
&sortdir=`ASC`
&sortby=`menuindex`
&tplAltTV=`Name_of_your_TV`
&includeTVs=`1`
&processTVs=`0`
]]
Hope this helps some of you.
The additional code in the snippet might not be most elegant one (and probabely it is not even safe/right), but it helped me.
Best wishes.