Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
parent in getTree()
Is there any reason why $parent
is omitted from the output array of getTree()
? I can see why it’s not needed in getTreePath()
since that extracts the whole route so the hierarchy can probably be determined with a bit of logic, but I can’t fathom why it’s not in getTree()
. People like me who love messing with hierarchy plugins would benefit imo; especially since ‘parent’ is already pulled out of the DB in the query.
One extra line would do the trick I think:
$out[] =
array(
'id' => $id,
'name' => $name,
'title' => $title,
'level' => count($right),
'parent' => $parent, // <--- HELLO!
'children' => ($rgt - $lft - 1) / 2
);
If there’s no reason for its exclusion, would it be possible to add it? Or if there is a reason for its omission, perhaps someone could enlighten me on how I might find all parent nodes for a given subset of/all children. Many thanks in advance.
Last edited by Bloke (2008-06-25 14:58:10)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: parent in getTree()
Will meditate about this later…
Offline
Re: parent in getTree()
Offline
Re: parent in getTree()
Eeeeeexcellent.
Thank you.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline