Paul,
> Can someone help me, and yes, I'll pay?!. I want an Access database that I
> can edit that contains link information. Pretty much a representation of
the
> Windows favorites directory.
>
> I want to query it and represent the information in an explorer- like
> treeview menu. A database driven tree structure as discussed by these guys
> in experts exchange:
>
>
http://www.experts-exchange.com/Web/WebDevSoftware/ColdFusion/Q_20120662.htm
l
>
> Seen a working example? Have one you wanna give or sell, point me to, etc.
> Please?
>
Have a look here : http://www.ivanpeters.com/
Ivan Peters has a great free tree product called Joust Outline Navigation
System.
It has a file that contains the JS arrays for the menu system, so you can
use CF to generate the contents of that file on the fly.
As far as the DB structure goes, a simple version would be.
LinkID AutoNumber
LinkTitle Text (50)
LinkURL Text(255)
LinkParentID Integer
LinkParentID is a reference to LinkID in the same table. Records with a
LinkParentID of zero are the top level and records with no content in
LinkURL are categories.
The way to get at the data is a self referencing SQL statement (not sure if
you can do this in SQL) or a recursive call to a tag.
Self Referencing SQL would go something like this (Some one correct the SQL
if I mess it up, please)
SELECT LT.LinkID, LT.LinkTitle,LT.LinkURL,LT.LinkParentID
FROM tblLink AS LT
LEFT JOIN tblLink AS LTP
ON LT.LinkID = LTP.LinkParentID
ORDER BY LTP.LinkTitle,LT.Link
I may have this wrong, so please don't take it as gospel.
Recursive tag calls make the SQL easier, but can get you stuck in a loop if
you aren't careful.
Attached (I hope) are two files dirtest.cfm and lisiting.cfm dirtest.cfm is
the outer display stuff that starts the call to listing.cfm, which is
recurses through the given directory, displaying only the content of the
folders specified in cookie.DisplaySelect.
There's a load of HTML in the pages to display the directory listings nicely
and the code was kind of "bunged" together, but you should be able to follow
it easily enough.
Hope this helps
Regards
Stephen
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm