> On our internal web page we have some links to various areas like Office Forms,
> Safety, etc... The supervisors that maintain these documents have access to
[quoted text clipped - 16 lines]
>
> Thanks!
Pretty much what you got should do it. The simplest change would be to
output entire directory structure on your current page, just nesting the
files and directories.
I would just create a looping output that uses the fields of the record
set to output the directories and the files with-in them probably as a
nested set of <ul> unordered lists.
If you want to break up this user interface into distinct units which
only list the contents of a current directory then just do the output as
you have it without using recursion. But make the sub-directory
listings links that when clicked repopulate the current page listing the
contents of the selected directory.
Neither should take a great deal of rework to your current interface.
Vidikron - 30 Jul 2008 18:29 GMT
Could you give me a rough example? I didn't write the current page and the
person that did is no longer here. Here's the code that thepage is currently
using.
The "target" variable is being passed in the URL. It's just the top level
directory where the listing of the files begins. "Morpheus" is our internal
web server.
<cfif target NEQ "">
<cfdirectory action="list" filter="*.*" recurse="no"
directory="#GetDirectoryFromPath(GetTemplatePath())#/#target#" sort="name ASC,
size DESC" name="rstDirectory">
<cfif rstDirectory.recordcount NEQ 0>
<cfoutput>
<table width="100%">
<tr>
<td>
<cfset counter = 1>
<cfset counterBack = 1>
<cfloop query="rstDirectory">
<cfif counter EQ 1>
<table align="left" <cfif style_page EQ
"3col_leftNav">width="50%"</cfif>>
</cfif>
<cfif counter EQ Ceiling(rstDirectory.recordcount / 2) + 1>
<cfif style_page EQ "3col_leftNav">
</table>
<table align="right" width="50%">
</cfif>
<cfset counterBack = 2>
</cfif>
<cfif counter EQ rstDirectory.recordcount + 1>
</table>
</cfif>
<tr>
<td class="TableText" bgcolor="###Iif(counterBack MOD 2 EQ 0,
DE('D5EAE9'), DE('FFFFFF'))#">
<a href="http://morpheus/mi/#target#/#rstDirectory.name#" title="File
Date: #DateFormat(rstDirectory.dateLastModified, 'dddd, mmm dd,
yyyy')#"><strong>#rstDirectory.name#</strong></a>
</td>
</tr>
<cfset counter = counter + 1>
<cfset counterBack = counterBack + 1>
</cfloop>
</td>
</tr>
</table>
</cfoutput>
<cfelse>
There are no files to display.
</cfif>
<cfelse>
<cflocation addtoken="no" url="http://morpheus/">
</cfif>
Ian Skinner - 30 Jul 2008 21:14 GMT
<cfparam name="url.dir"
default="#rereplace(getDirectoryFromPath(getCurrentTemplatePath()),'\\$','','ONE')#">
<cfdirectory action="list" name="allDir" directory="#url.dir#"
recurse="no" sort="ASC">
<cfoutput>#url.dir#</cfoutput>
<ul>
<cfoutput query="allDir">
<cfswitch expression="#allDir.type#">
<cfcase value="FILE">
<li>FILE: #allDir.name#</li>
</cfcase>
<cfcase value="DIR">
<li>DIR: #url.dir#\#allDir.name# <a
href="directoryFun.cfm?dir=#url.dir#\#allDir.name#">View</a></li>
</cfcase>
</cfswitch>
</cfoutput>
A simple directory display creating links to sub-directories.
A leave it to you to flesh out with your desire user interface and back
links to parent directories.