Tell me, please, how to implement this. There is a resource tree:
ресурс вложенный ресурс
in chunk generat link so Makar
[[~[[+id]]]]
This link to your own resource, how to make the link lead to a nested resource ???
Tell me, please, how to implement this. There is a resource tree:
ресурс вложенный ресурс
in chunk generat link so Makar
[[~[[+id]]]]
This link to your own resource, how to make the link lead to a nested resource ???
I understand that you insert a chunk into a resource and the link is obtained on the resource itself, but on the child? Try using this snippet .
Hooray solution found.
1) Create a snippet with this content.
$depth = isset($depth) ? $options : '1'; // default limit to 1 levels deep $array_ids = $modx->getChildIds($input,$depth,array('context' => $modx->context->key)); if(!is_array($array_ids)) return $input; // if no children, we will return the id resource return $array_ids[0];
2) Call it in the template with this method
[[~[[+id:getChildIdResoirceId]]]]
3) By default, the depth is 1, if you need to change it, just pass in the options, i.e. for example on 3
[[~[[+id:getChildIdResoirceId=`3`]]]]
That's all the solution. A big thank you to the MODx forum, namely Artdevue
Source: https://ru.stackoverflow.com/questions/199394/
All Articles