Travis IM'd me while I was away with some information regarding a possible way of to do this efficiently:
Hey. I just saw the posts on the Ultimate Parent and $modx->genes
Just thought I'd mention that there may be a "nicer" way to do this that wouldn't cause any overhead when using it, only when saving a page. First, this article:
http://www.codeproject.com/database/modhierarchies.aspThe second is to simply store a lineage field with the records:
1-2-3-5, for instance
So sid 1 would have a lineage of 1
Sid 2 that is a child of 1 would have 1-2
Sid 3 would have 1-2-3
Sid would have 1-2-3-5
When adding a new page, you simply ask the parent page for its lineage and add yourself to the end
Pulling 1-2% would give you sid 2 (the parent) plus all children
Sorting by lineage gives you the entire tree in proper order
Etc
Facilitates pulling the entire tree, in tree form, with a single query
Not the most efficient method, but for something like you all are talking about, might be worth considering for its simplicity when inserting and when working with it... Makes it very trivial to find any parent or any child
Just a thought; I'm sure you all will probably find a better method.
Let the wheels start turning.
