This seems like a pretty common task I want to do, but I can't wrap my head around the cfloops and cfqueries.
I have a database full of photo galleries. They all have an ID and a ParentID (except the root galleries - their ParentID is blank), and they can go multiple levels deep. Here's an example of the gallery structure:
I want to automatically output this structure above into nested ul's and li's (just like above). How is that done? I can't wrap my head around the placement of the ul's and li's to display the hierarchy levels correctly.
I guess the simpliest solution would be to use Query of Query...
If the dataset is huge, try <cftree> and populate the leaves on demand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With