Description of Problem:
I want to make a page for customers and its projects but it is not working the way I'm doing it. Maybe getResources is not the right tool to make multi-level pages. Here's what I want:
Expected Outcome:
Page Customers
- Customer 1
- Project A
- Project B
- Customer 2
- Project A
- Project B
- Customer 3
- Project A
- Project B
What I did:
I make a getPage call from Page customers to it's childrens:
<table class="clients">
[[!getResources?
&parents=`[[*id]]`
&depth=`0`
&tpl=`tpl-CustOverview`
&sortby=`{"menuindex":"ASC"}`
&includeTVs=`1`
&processTVs=`1`
&includeContent=`1`
&debug=`1`
]]
</table>
Then in the getResources template, I make a second call for projects inside each customer:
tpl-CustOverview:
<tr>
<td>[[+tv.customerLogo]]</td>
<td class="client-desc"><h3>[[+pagetitle]]</h3>
<div class="clientsText">
[[!getResources?
&depth=`1`
&tpl=`tpl-CustDetail`
&sortby=`{"menuindex":"ASC"}`
&includeContent=`1`
&debug=`1`
]]
</div>
</td>
</tr>
What I get (of course wrong):
- Customer 1
- Customer 2
- Customer 3
- Project A
- Project B
- Project A
- Project B
- Project A
- Project B
- Customer 1
- Customer 2
- Customer 3
- Project A
- Project B
- Project A
- Project B
- Project A
- Project B
- Customer 1
- Customer 2
- Customer 3
- Project A
- Project B
- Project A
- Project B
- Project A
- Project B
I think the reason of this behavior is that both getResources call are using the same ID
because both are being called from the same resource (I guess).
Does anybody out there can help me to solve this problem?
Thank you in advance.
- MODX Version: MODX Revolution 2.2.5-pl (traditional)
- PHP Version: 5.3.5
- Database (MySQL) Version: 5.5.9
- Additional Server Info: Apache 2.0
- Installed MODX Add-ons: Babel, Breadcrumbs, getPage, getResources, SimpleSearch, TinyMCE, UltimateParent, Wayfinder