> html::template. I get the guestbook-data via DBi from a MySQL-Server. > I process this data within a recursive function, which calls itself > until no record has any more children. By now I append all html-data with
First, the part that isn't your question, but I feel opinionated :) Recursion is expensive. I've done this in two other ways, depending on my data: 1) Select all data from table (including info on which nodes are children of others, then sort.) 2) create a list (initially of just the root). Move through this list, inserting (splice()ing) any children of the current node just after the current node. This is my preferred method. IT also allows me to store the "depth" (relative to root) of each node. > => $html) and this works fine. but this is bad if you want to style > certain rows in a different way from other rows. But i don't know how to I just offer my data as a list to my template, which can then style the output based on the depth of the node (since that is now in the data). For example, each node usually has (NodeID, Depth, Name, Title, Text, Date). I can indent or otherwise indicate the depth on a per-row basis, and all HTML formatting is done in the template. Hope that helps in some fashion. -- SwiftOne / Brett Sanger [EMAIL PROTECTED] ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Html-template-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/html-template-users