Hello,
Is it possible to get related data via getCollectionGraph() and then use something like
in a template to access the nested/related data?
In other words, if I fetch a record that has relational data, and need to use fields from the related record in the chunk, I currently do:
$obj = $modx->getCollectionGraph('Workorder', '{ "Team":{}}', $id);
$data = $obj->toArray();
$data['team_name'] = $obj->Team->get('name');
$html = $modx->getChunk('workorder_form', $data);
which can get cumbersome with deeply related data. Is it possible to do something simpler like pass the obj returned from getCollectionGraph() to getChuck and use a placeholder syntax like
in the chunk?
[ed. note: pallen last edited this post 14 years, 11 months ago.]