We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
OK, so someone asked what context my ugly reference question was in yesterday, and since what I'm doing might be useful for someone else, I thought I'd post the problem and my solution to see if (a) someone else could use it or (b) I'm reinventing the wheel and there's a better way commonly known.
OK, so this page structure on a web site: 1 |_2 | \_5 |_3 \_4is stored as 'treepaths', like this: 1 => 001:000:000 2 => 001:002:000 3 => 001:003:000 4 => 001:003:004 5 => 001:002:005that way, sorting them on these values brings them out in the desired display order. Now, I want to display a lovely graphical tree depicting this, so I have 5 graphics and assign them values: - a blank square (0) |#| - a page icon (1) |_ - an 'L' shape icon (2) | - a vertical pipe icon (4) |- - a "t' shape icon (6)So to create the correct matrix, I take the following rules:
Or am I making a mountain out of a molehill? cLive ;-) In reply to representing a tree graphically... by cLive ;-)
|
|