This is my first plugin, written in response to this post. This plugin allows you to specify a path (NOT FULL URL) and it will iterate over the contents and print an ordered or unordered list of the files. It can optionally filter out various filetypes as well as create links to the files. It also allows CSS customization, as classes can be passed in for the list, list items and anchor tags. Of course, please let me know of any bugs you find.
*File updated to version 1.1 12/20/08 - Added ability to sort links using optional parameter of sort=“asc” or sort=“desc”.
Another thought, this would be neat to have as a custom field in the CP. For example, some sites I built need to have large mp3’s uploaded through ftp. The person updating the site could then make a weblog post and select the file they posted from a list (this could save them making a typo).
Not a valid directory path:/usr/local/psa/home/vhosts/example.com/httpdocshttp://www.example.com/images/site/layout/
Not too sure why it does that or what you would have to do to fix that but would be nice if it could work with the (as yet undocumented ){site_url} variable.
Another thought, this would be neat to have as a custom field in the CP. For example, some sites I built need to have large mp3’s uploaded through ftp. The person updating the site could then make a weblog post and select the file they posted from a list (this could save them making a typo).
That is a nice thought. Would make things really easy for clients and we all know that they need every little bit of help they can get with things!!
If you can’t get {site_url} to work then no worries as it doesn’t matter about having to hard-code that bit into the template. Jeremy’s suggestion is a great one though so if you want to forget mine then please do
Yep found that in the code and un-commented already but thanks for looking into that. Using this in the CP really would be excellent if you can get that working
I’ll take a closer look at this when I get home tonight. At the moment I don’t know where I’d begin to make this a custom field in CP. But hey, how hard could it be?
Brad, thanks for this - but honestly I lost track of your versions already.
Could you use a numbering scheme for the file? I’m in another time zone and really don’t now it I visited the thread before or after 1:30pm EST
Haha - sorry about that. The newest version is at the top of this thread, and was from 1:30pm EST (-5 GMT). At any rate - will increment version from here on out.
I’m really glad that you found this useful. I answered a related thread earlier where someone had commented on it - and I had all but forgotten about this (as most of the time I code directly in PHP (now with CI) as opposed to EE. At any rate, just wanted to say thanks for trying it out and finding a use for it.
Updated the plugin per your request to now accept a sort parameter, such as sort=“asc” for ascending or sort=“desc” for descending. If the sort parameter isn’t passed, it will display links in the same order as they are within the folder.
The updated file is available via link in the first post of this thread.
Thanks for using the plugin and your kind comments about my music. Glad you found the module useful. I too am always impressed by the community surrounding EE.
This plugin was my first attempt at enhancing EE, and hadn’t been touched in quite some time. Needless to say, I ended up rewriting the code for this when I had a chance to open it up and look at it again. Anyways, happy to help. Let me know if you think of any other ways to make this plugin better.