Okay, here’s my best shot at explaining what I want to do. :’(
I want to have a wrapper div on the template for a modx container page.
Within that wrapper, I want to load a row for each child of the container page. I presume that getresources is the best method for this.
The tricky part is that I want to have those rows be formatted differently, according to the templates of the child pages.
So if my site tree looked like
Folder [template: post]
- Page1 [template: row style 1]
- Page2 [templatte:row style 2]
my output would look like
<div class="wrapper">
<div class="row1">(page1 content here)</div>
<div class="row2">(page2 content here)</div>
</div>
FWIW, the differences in actual row formatting are more substantial, and involve nested divs with assorted TV data.
So far, here’s what I’ve tried:
There’s a template for the post (with the wrapper), and templates for each of the possible row types (3 column, 2-1 split column, 1-2, 1-1-1). Each row template has an appropriate number of TVs.
In the post template’s wrapper, I call getresources with a parent of ID, to load all the children.
The problem is that I can’t seem pull the template formatting into the tpl chunks.
Ideally, I’d like to have a chunk rowTpl with just [[+content]], and that would pull in everything already formatted by the template, but apparently that’s not the case.
So is there any way to do that?
An alternative could be something like a switch case statement within getresources, where different tpl chunks are called depending on the template of the resource being returned.