Query to Unordered/Ordered List with hierachy

Dec 12, 2009

This has been bugging me for ages - how to take a query object, and loop it into an unordered/ordered list, with the script working out when the various 'LI' and 'UL' elements should be closed or opened.

I didn't want to specify a parent item in the query, all I wanted to do is specify the depth - i.e how many levels from the top the LI element is.

So here, for the greater good (or bad, depending if you like/agree with my code) is my solution....

http://www.oxalto.co.uk/demos/list/

Ideas on how I might improve this to be more efficient welcomed!

Comments

Mark Flewellen

Mark Flewellen wrote on 12/13/09 7:26 PM

Doesn't seem to work on CF8. I take it is because of some of the new functionality in cfscript.
Tom

Tom wrote on 12/13/09 8:52 PM

Thanks for the heads up, I've done a version without cfscript (I was testing on Railo 3.2 which is ahead of CF8, but behind CF9 in terms of cfscript support)

http://www.oxalto.co.uk/demos/list/listdemo_w_tags.txt
manilatd

manilatd wrote on 12/17/09 10:11 AM

Wow there is a lot of coding in that demo. I have to research more and check it out.

Write your comment



(it will not be displayed)



Leave this field empty: