So, I thought I would share with the Drupal community some code I wrote to create a browsable tree view of vocabularies in a taxonomy that are all single level. After days of searching (without any luck) for a module that would create a tree structure of my single level vocabularies, I wrote some code that dynamically creates the tree structure.
So why not just create the vocabularies in a tree structure to begin with? I think this is the norm for many sites, but the nodes in my site do not have a clear tree hierarchy that is agreed upon by all of the people that use my site, as well as if you want to change the tree structure (with many nodes already added) it's not that easy. Plus, I wanted the tree structure to be dynamic. In fact, I want to be able to offer different trees to accommodate different users.
The method to creating the tree structure is to define the vocabulary hierarchy using the vocabulary ids (4,8,6,2: where these are the vid's of the vocabularies I want to create a tree for). Then, traverse the vocabularies, in the above order, using the terms as folders, and the nodes as the tree leaves. The nodes in the sub terms/folders must be present in the parent folder. Thus, creating a tree view of the nodes across single level vocabularies.
Here is the code in action:
http://www.videobjj.com/?q=tree