Use FileGenie with Dynamic Folders Support
Question:
How can I use FileGenie to show images on a dynamic database page with variable folders?
Answer:
Having FileGenie show images on a dynamic page from a variable folder is really not that difficult.
First of all you create a dynamic page on which a recordset is created, depending on a Querystring, a Form Variable or a Session Variable.
Next, you create a standard FileGenie Folder List that directs to a main folder of your choosing and you make sure the Folder List is displayed on your page using a Folder List Repeater or a Folder List Table.
For the rest of the tutorial I assume that all of the variable folders are within the selected main folder.
Also, I assume that the variable folders have names that can be fetched from a recordset.
As a next step you have to be in Code View. Find the Folder List code and make sure the code for the recordset is above the Folder List code. Next, you define a variable which collects the variable folder name from a recordset.
<%
Dim YourVariable
YourVariable=(YourRecordsetName.Fields.Item("YourRecordsetField").Value)
%>
Now edit the Folder List code. Place &YourVariable behind the code for the .Path. Your complete code could like like this:
<%
' *** Folder List 1.0.7
Dim YourFolderlistName
Set YourFolderlistName = New FolderList
With YourFolderlistName
.Path = "yourmainfolder/"&YourVariable
.allowedExtensions = "GIF,JPG"
.includeFolders = false
.ShowThumbnailsOnly = true
.ThumbnailsSuffix = "_small"
.officeAttributes = false
.ReadFolder()
.SortOn "DateLastModified", FG_SORT_DESCENDING
End With
%>
Do not put the code for the creation of the variable at the top op the Folder List code. This would cause the Folder List to disappear from the Server Behaviors used.
That's basically it. Preview the result on a live page and see what happens!
I'd really appreciate your feedback on your results! If you have any more questions just let me know!
Comments
Be the first to write a comment
You must me logged in to write a comment.