profwannabe
Programmer
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="Site" datasource="#datasource#" dbtype="odbc">
SELECT d.*,p.*
FROM DIRECTORIES d, PAGE_DISPLAY p
WHERE d.DirectoryID = p.DirectoryID
ORDER BY DirectoryName, TemplateName
</cfquery>
<cftree name="Site" bold="No" italic="No" border="No" hscroll="No" vscroll="No" required="No" completepath="No" appendkey="No" highlighthref="Yes">
<cftreeitem value="DirectoryID, TemplateID" display="DirectoryName, TemplateName" parent=",,DirectoryID" img="fixed, folder, document" href=",,index.cfm?fuseaction=dspEditTemplate&#application.addtoken#&TemplateID=#MeritageSite.TemplateID#" query="Site" queryasroot="Yes" expand="Yes, No">
</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.
<cfquery name="Site" datasource="#datasource#" dbtype="odbc">
SELECT d.*,p.*
FROM DIRECTORIES d, PAGE_DISPLAY p
WHERE d.DirectoryID = p.DirectoryID
ORDER BY DirectoryName, TemplateName
</cfquery>
<cftree name="Site" bold="No" italic="No" border="No" hscroll="No" vscroll="No" required="No" completepath="No" appendkey="No" highlighthref="Yes">
<cftreeitem value="DirectoryID, TemplateID" display="DirectoryName, TemplateName" parent=",,DirectoryID" img="fixed, folder, document" href=",,index.cfm?fuseaction=dspEditTemplate&#application.addtoken#&TemplateID=#MeritageSite.TemplateID#" query="Site" queryasroot="Yes" expand="Yes, No">
</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.