Filter FileGenie Folder List by first characters Support
Question:
How can I filter the FileGenie Folder List to only show the files that start with specific characters?
Answer:
First create a Folder List like any other. Also apply a Folder List Repeater or a Folder List Table to show the files on your page.
Now some code will be added to check is the filename starts with specific characters. In this example the setting for checking the first three characters will be used.
Switch to Code View and find the code for the Folder List Repeater. Right below the start of the repeater (the beginning of what should be shown on the page), insert an If-Statement. Enter the following Condition for this statement: Left(YourFolderList.Files("Name"),3) = "xxx". Scroll down and insert an End If-Statement right before the end of the repeater. This code now checks to see if the first three characters from the left contain the value xxx. If this is true, the value will be shown. If not, the value will be skipped.
Your code should look like this:
<%
' *** Folder List Repeater Start
while YourFolderList.CanRepeat()
%>
<% If Left(YourFolderList.Files("Name"),3) = "xxx" Then %><%= YourFolderList.Files("Name") %><br /><% End If %>
<%
YourFolderList.MoveNext
wend
' *** Folder List Repeater End %>
Of cource you can edit the code as you please. Change the value for the number of characters, change the characters to look for, or even create a filter-field that posts back to the same page, to give the user the option to dynamically search for starting-characters.
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.