What is it all about?

DBTree is a Coldfusion Custom Tag for visualizing and managing hierarchical structures from a database table.
It creates unordered HTML lists by transforming database table entries wich should meet minimal demands. Each record on the table must have an auto incemented column for the id, a column for the parent id and an additional column named "sortorder".

Table SetupThat's all to create a tree structure. You can see in the image for example, the ID 45 has parent_id=0 wich means it has no parent node and it is on the top level (root) of the tree.

The ID 65 has a parent_id=64, so it is a child of 64. It's sortorder is 1, so it is the first child.

Modify the TreeThe sortorder always begins from 1 in each branch of the tree and goes up to 2,3,4, and so on. We recommend to just setup an empty database table with the required fields and use DBTree's modify functionality to insert, delete, edit and sort the database records.

Once you have a table with parent-child relations, you can assign DBTree to output an unordered HTML list or a select box.

With an appropriate CSS Stylesheet you can then implement wonderful, lightweight and fully W3C standards conform and search engine friendly multilevel dropdown menus.
We also provide you with a small javascript file, wich you will need for these anvanced features.

CSS styling an unordered list

 

Add your comment to this page Add Comment
Join for a free account, or login if you are already a member.