Hello Chaps,

 

I've done this kind of thing before, but for some reason I'm struggling to
remember quite how I did it. I'm building a dynamic menu system from a
database table. The table contains all the pages for the site within it, and
it's a self relating table which uses a 'parent_id' column to define which
parent each page belongs too.

 

If the page does not have a parent, then the parent_id is set to 0 and these
should effectively be on the top level of the menu system. In proper css
fashion the plan is to have the menu as an un-ordered list, which should
look something like this:

 

<ul>

                <li>Top Level Item</li>

                <li>Top Level Item 2

                                <ul>

                                                <li>Child of item 2</li>

<li>Child of item 2</li>

<li>Child of item 2</li>

<li>Child of item 2</li>

</ul>

<li>

<li>Top Level Item 3

                <ul>

<li>Child of item 3</li>

<li>Child of item 3/li>

</ul>

</li>

 

</ul>

 

However I'm struggling to get the 'groupby' clause quite right on the
outputs, can anyone offer any advice on this? I want all items with
parent_id as 0 on that top level, and then there corresponding children
displayed in the nested lists.

 

Thanks for any help you guys can offer.

 

Rob



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:286043
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to