In a reversal of yesterday's post is today's, getting a path to a node, or nodes. Basically we just use the core getpath() function of the Tree behavior and traverse that path.
function setTreePath(&$data, $path='tree_path', $label='name') {
if (!is_array($data) || !in_array('Tree', $this->actsAs)) {
return $data ...
read more
There are comments.