Claude and Leigh,

The parent, child, and grandchild pages are sorting as needed now and I have
formatted the display to be reader-friendly. Leigh, your code made perfect
sense. Claude and Leigh and others, thank you for your expertise. Enjoy the
rest of the weekend.

Best from Eric



 
-----Original Message-----
From: Claude Schnéegans <[email protected]>
[mailto:=?ISO-8859-1?Q?Claude_Schn=E9egans <schneegans@interneti=71?=
=?ISO-8859-1?Q?ue.com=3E?=] 
Sent: Sunday, March 25, 2012 10:33 AM
To: cf-talk
Subject: Re: Display a list of Parent and Child pages by Sort Order, with
children arranged under their respective parents


 >> I am trying to display a
list of Parent and Child pages, with children arranged under their
respective parents, thus:

This is one of the best case a recursive custom tag can be used.
Every row in the table should have a column with parentId pointing to its
parent.
No need for parents pointing to children.
Elements at level 0 have parentId set to 0.

So the main template should call some custom tag like <CF_buildTree id=0>
This tag will query (say "MyQuery") the table with the WHERE
parentId=#attributes.id# clause.
Then looping on this query, display whatever you need from a record and for
every record: <CF-buildTree id=#myQuery.id#> The recursion will stop on an
empty query.
You may add an attribute to the tag for indentation, ...



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350535
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to