|
Cookbook /
FileListSummary: Tabulated filelist markup as alternative to
(:attachlist:), for a simple, easy readable look.Version: 2007-09-01a
Prerequisites: pmwiki 2
Status: new
Maintainer: HansB
Categories: Uploads
Questions answered by this recipeHow can I have a simple, easy readable file list?
Description(:Description FileList adds markup for a clean looking tabulated file listing as an alternative to the attachlist markup:) Download filelist.phpΔ and dot3.pngΔ, copy filelist.php to
cookbook directory, and dot3.png to your Farm/pub/images/ directory.
Install in config.php with -> Use markup Sample image of a filelist (with European style date formatting): Set $FileListTimeFmt for your preferred date & time format. For example: $FileListTimeFmt = '%d %b %Y'; - day short month year
$FileListTimeFmt = '%B %d, %Y'; - long month day, year
$FileListTimeFmt = $TimeFmt; - PmWiki default time format
Notesfilelist.php includes a modification of the FmtUploadList function from scripts/upload.php. The dot3.png image is used purely stylistically to provide a line of not too obtrusive dots between the file names and the file sizes, to aid the eye. File sizes display as shorter Kb instead of more exact but longer byte sizes. Sortable FileListI'm uploading filelist_sortable.phpΔ It's a Modded version of filelist.php which uses the sorting functionality of AttachListSort.php Basically this allows you to have the presentation of FileList while having the sorting functionality of AttachListSort. So for example, you can type (:filelist sort=date:) and it'll sort by date. All of AttachListSort's syntax (as it was on 2008-02) works. What's in itI created it by copying the function from AttachListSort.php into FileList.php, adding a few lines to call the function, changing the sorting function to return only the ordered filelist, and commenting out some now-redundant code. InstallationTo install filelist_sortable.phpΔ, just download it into your cookbook folder, comment out (using a number sign (#) before the line) or just take out any include lines you made for filelist.php or AttachListSort.php and insert an include line like include_once("$FarmD/cookbook/filelist_sortable.php");
'''Don't forget to download dot3.pngΔ and put it in your /pub/images/ directory (that is, if you haven't already).''' Release Notes
CommentsHi. thanks for this - it looks/feels nice. however, i noticed that while FileList seems to work great with pages that already have files uploaded to them, it malfunctions when added to a page with no uploaded files - it produces this error:
I found that providing the simple conditional Also, two suggestions for coders more able than I:
Just some ideas overtones99 (2008-03-05) If I remember discusssions about this correctly, filelist has quite different needs than pagelist, and it is not very feasible to port pagelist capabilities to filelist. So anything for file listing needs to be developed separately. HansB See AlsoContributors |