Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFTreeItem problem

Status
Not open for further replies.

profwannabe

Programmer
Jan 6, 2001
53
US
I am trying to display a tree in which the lowest branch is a URL that would pass the TemplateID value along to an edit template. My tree displays correctly but the lowest branches are all the same: the final record of the query.

<cfquery name=&quot;Site&quot; datasource=&quot;#datasource#&quot; dbtype=&quot;odbc&quot;>
SELECT d.*,p.*
FROM DIRECTORIES d, PAGE_DISPLAY p
WHERE d.DirectoryID = p.DirectoryID
ORDER BY DirectoryName, TemplateName
</cfquery>

<cftree name=&quot;Site&quot; bold=&quot;No&quot; italic=&quot;No&quot; border=&quot;No&quot; hscroll=&quot;No&quot; vscroll=&quot;No&quot; required=&quot;No&quot; completepath=&quot;No&quot; appendkey=&quot;No&quot; highlighthref=&quot;Yes&quot;>

<cftreeitem value=&quot;DirectoryID, TemplateID&quot; display=&quot;DirectoryName, TemplateName&quot; parent=&quot;,,DirectoryID&quot; img=&quot;fixed, folder, document&quot; href=&quot;,,index.cfm?fuseaction=dspEditTemplate&amp;#application.addtoken#&amp;TemplateID=#MeritageSite.TemplateID#&quot; query=&quot;Site&quot; queryasroot=&quot;Yes&quot; expand=&quot;Yes, No&quot;>

</cftree>

Not sure why the Template displayed is not related to the Directory. I have tried separating out the cftreeitem statements, to no avail. I have also tried embedding a cfloop tag around the lowest branch and separating out the queries, such that the templateIDs would be generated for each iteration of the loop querring only for directoryIDs. In that case I saw all the TemplateIDs for each DirectoryID.

Hope my description is relatively complete and straightforward. Not sure if the problem is the query or the cftreeitem tags, but I believe it to be the latter.
 
Update:

I have also embedded at the top of the page the following:
<cfoutput query=&quot;Site&quot;>
<ul>
<li>Directory: #DirectoryName# / #TemplateName#
</ul>
</cfoutput>

It gives me exactly what I am looking for; thus it seems the problem lies within my cftreeitem tag.

 
Sorry about the debugging updates, but I think I am narrowing down the problem without being able to solve it.

In the href line of the cftreeitem tag I am trying to pass the TemplateID from the query. However, the href for every branch contains the same TemplateID, which corresponds to the first templatename displayed in my <ul> described above. Not sure why that is the case, since the DirectoryName and TemplateName are displayed correctly!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top