Articles tagged with "tree"

Threaded Lists

By James Hall
Ever needed a tree of sections with an unlimited depth? Here's a quick guide to findAllThreaded().
[Read more]

Tree Helper

By James Hall
A helper to format the output from findAllThreaded() into a HTML list.
[Read more]

Modified Preorder Tree Traversal Component

By Michael Patek
A component for retrieving, printing, inserting nodes into, and deleting nodes from trees stored in mptt form.
[Read more]

Populating Select Boxes with Tree Paths

By Ben Snider
If you populate select boxes with a tree, and your tree has many nodes, which can be named the same, you are often left with an unusable select box. The following methods will help alleviate this problem by displaying the nodes in the select box as a path from the root of the tree.
[Read more]

ScopedTreeBehavior

By Martin Samson
ScopedTreeBehavior let's you manage several different tree within the same table, each tree being separated by a 'scope' such as another model id or a simple tree id. It was built with UUID in mind. Some logic based on Core TreeBehavior. Trying to manage different trees is troublesome and produce weird behaviours when using moveUp and moveDown. ScopedTreeBehavior fix theses issues.
[Read more]

Serializing find("threaded") data to XML

By Rodrigo Reyes
Ever tried to serialize a full find("threaded") tree to XML? Well, it won't be easy to consume. Unless you give a try with XMLTreeHelper.
[Read more]

BTree Behavior

By jas osborne
The standard Tree Behavior has a problem causing add/delete based performance degredation bound by the size of the table. In a table of 1 million nodes a single add or delete can currently cause up to 2 million discreet operations. To reduce the effect of this degradation I propose introducing fragmentation and partitioning to the Tree table, thereby significantly reducing the overhead of destructive or additive operations.
[Read more]

Nested Tree Behaviour

By Jaco
I quite like the Tree Behaviour.
But unfortunately the 'separator' idea is a little too primitive for flexible HTML.
The problem lies in the fact that generatetreelist always returns a flat structure.

Here's a way to return a structure grouped by parent_id, which would allow you to intelligently traverse the tree.
[Read more]

MultiTree Behavior

By Thom
MultiTree is a drop-in behaviour to CakePHP's Core Tree Behavior allowing for more advanced operations and better performance on large data sets
[Read more]