My first question, though I suspect this might not be the best approach . Is it possible to turn a query (cfdirectory in this case) into a comma separated list?

The reason I ask is bcos currently I have a hardcoded list of folders in my action file, and I loop through and pull all the files from each. Like so...

<cfloop
  index = "thisItem"
  list = "maps,districtPlans,mgmtPlans">

<cfdirectory
  name="getAllFiles"
  action="">   directory="#serverdir##thisItem#"  
  sort="name ASC">

<cfquery dbtype="query" name="getAllFiles_#thisItem#">
  SELECT *  
  FROM getAllFiles
</cfquery>

</cfloop>

and in the display page something like...
<ol>
<cfoutput query="getAllFiles_maps">
#replace(listFirst(name), "_", " ", "ALL")#<br />
</cfoutput>
</ol>
<ol>
<cfoutput query="getAllFiles_mgmtPlans">
#replace(listFirst(name), "_", " ", "ALL")#<br />
</cfoutput>
</ol> etc etc
--------------------

This is all working fine. BUT, instead of hardcoding the list, I can do another directory call like so...

<cfdirectory
name="getAllFolders"
action=""> directory="#serverdir#"
sort="name ASC">

which will give me all the folders that are in the above list (ie maps,districtPlans etc). So, how to get the query to a list so I don't need to hardcode? OR, is this the wrong approach and is it possible to use the getAllFolders query directly in some fashion?

TIA
Mark
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to