This is just to share that I have rewritten the module to be more flexible (for my own need)
I should not call it Simple Tree tho, because seem like many ppl dont think it's that simple, any how, to sum it up:
1. It's easier, more flexible now to tell the tree the "wrapper" you want to put the parent - children in, example:
PHP Code:
echo $_SESSION['category_tree']->buildCategoryString('<ul class="{class}">{child}</ul>', '<li class="{class}"><a class="{class} category-top" href="{link}"><span>{name}</span></a><span>|</span>{child}</li>', 0, 2, 1, false, true);
2. Can attach other links to the tree, example:
PHP Code:
$_SESSION['category_tree']->attachToCategoryTree(array('name'=> HEADER_FILENAME_SOMETHING2, 'cPath' => zen_href_link(FILENAME_FILENAME_SOMETHING2, '', 'NONSSL', false), 'id' => 'sell', 'children' => array(
array('name'=>HEADER_FILENAME_SOMETHING1, 'id' => 'sales', 'cPath' => zen_href_link(FILENAME_FILENAME_SOMETHING1, '', 'NONSSL', false)),
array('name'=>HEADER_FILENAME_SOMETHING, 'id' => 'listings', 'cPath' => zen_href_link(FILENAME_SOMETHING, '', 'NONSSL', false))
)));
I guess other than that and a number of other small features it remains the same:
1. It uses only 1 single query to get the tree
2. It can cache the tree
3. You can put it anywhere
4. You can have as many trees on the same page as you want
5. Limit maximum level of cat to display
6. Choose to always expand or not.
7. You can start the tree from any category, example:
on a recent project, I have 3 boxes: grand parent, parent, and children. Parent box links depend on which category is currently active on the grandparent box, and children box display links depending on links currently active on parent.
With this module, you can tweak it to anything you want, expanded category, ajax tree type etc....
Well, but again we have people having frustrating time with this module in the past since they dont know php, and you HAVE to know a bit about PHP to well, at least know which parameters you should pass into the function. So I will not post the module here to avoid such frustration, if you are interested and think you can handle it with little help from me, post here or send a PM. I will send it to you.
Bookmarks