Summary
I’m exploring Fenom and in general template engine in MODx trying to simplify chunks/templates structure to be more dynamic.
Step to reproduce
I have this pdoResoruce call:
[[pdoResources?
&parents=`[[+id]]`
&resources=`[[+includeOrExclude]]`
&depth=`0`
&limit=`0`
&sortby=`{"menuindex":"ASC","pagetitle":"ASC"}`
&includeContent=`1`
&showHidden=`1`
&setTotal=`1`
&totalVar=`sectionCount`
&tplWrapper=`@INLINE <div class="d-flex">[[+output]]</div>`
&tpl=`@INLINE <div class="col-6">
{if $isfolder}
{$_modx->runSnippet('pdoResources', [
'parents' => "{$id}",
'depth' => 0,
'sortby' => ['menuindex' => 'ASC'],
'tpl' => '@INLINE
{if $isfolder}
[[!$textDescriptionItems?&testID=`{$id}`]]
{else}
<div>{$id} single element</div>
{/if}'
])}
{else}
<div>{$id}</div>
{/if}
</div>`
]]
and then thats the content of textDescriptionItems chunk:
<h1 style="font-size: 120px">[[+testID]]</h1>
[[pdoResources?
&parents=`[[+testID]]`
&depth=`1`
&limit=`0`
&sortby=`{"menuindex":"ASC","pagetitle":"ASC"}`
&includeContent=`1`
&showHidden=`1`
&setTotal=`1`
&totalVar=`sectionCount`
&tplWrapper=`@INLINE <div class="d-flex">[[+output]]</div>`
&tpl=`testChunk`
]]
and thats content of testChunk:
[[+id]]
Observed behavior
In this part:
<h1 style="font-size: 120px">[[+testID]]</h1>
im reciving correct ID, however once passed to the pdoResrouces:
&parents=`[[+testID]]`
This seems to be invalid because pdoResoruce returns all the IDS - seems like its 0 or invalid so modx thinks no parent i will start from top.
Does anybody know if this sytnax is correct, or maybe something like this is not allowed?