Table of Contents

Media Listing Plugin

This plugin shows file listings of media directories. It was inspired by the dirlisting plugin. It has many options and flags to control the generated listing.

Usage

Syntax

{{medialisting>[options] [flags]}}

Options

OptionDescriptionExample
dirroot directory for listing (this is a sub dir under the media folder)dir=“docs”
maskfilter for directory items matched against their base name (this is regular expression)mask=“\.pdf$” or mask=“\.(pdf|zip)$”
titletitle of listing (the pipe sign forces a line break)title=“File Index”
sortsort items by a field: (basename, fullname, size, mtime, ctime (default is basename)sort=“size”
limitrestrict how many items are displayedlimit=“2”

Flags

FlagDescription
sizeshows file size in human readable form
ctimeshows file creation date and time in format YYYY-MM-DD
mtimeshows file modification date and time (same format like ctime)
commalistdoes not render a table but a comma separated list of directory items (comma lists are always aligned to the left)
reversereverts sort order
recursiveincludes sub directories
headerdisplays header
nicebeautifies file names by changing underscores to blanks and removing file extensions
smallgenerates a single column table without fixed width

Installation

Download the plugin and unpack the archive under the dokuwiki plugin directory.

Download

Download files in zip or compressed tar format:

Examples

Embedding a directory listing as comma separated list as part of an unordered list

Source:
  * Some things
  * {{medialisting>dir="images" mask=".*" limit=2 commalist nice}}
  * More things
Result:

Embedding directory listings in tables

Source:
^Section^Files^
|Demo 1|{{medialisting>dir="images" mask=".*" reverse sort="mtime" limit=2 mtime ctime size}}|
|Demo 2|{{medialisting>dir="images" mask=".*" reverse sort="mtime" limit=2 mtime ctime size}}|
Result:
SectionFiles
Demo 1
free64.png5Kb2006-12-082007-07-19
freedb64.png9Kb2006-12-082007-07-19
Demo 2
free64.png5Kb2006-12-082007-07-19
freedb64.png9Kb2006-12-082007-07-19

Embedding directory listings in boxes using the divclass plugin

Source:
<divclass box half left green nobullets noindent|Left>
{{medialisting>dir="images" mask=".*" limit="2" nice small}}
</divclass|sorted>
 
<divclass box half right red nobullets noindent|Right>
{{medialisting>dir="images" mask=".*" limit="2" nice reverse small}}
</divclass|reverse sorted>
Result:
Left

Right

Showing all columns with header reverse sorted by modification time and limited to 2 items

Source:
{{medialisting>dir="images" mask=".*" reverse sort="mtime" limit=2 mtime ctime size header}}
Result:

 
free64.png5Kb2006-12-082007-07-19
freedb64.png9Kb2006-12-082007-07-19

Showing a small listing

Source:
{{medialisting>dir="images" mask=".*" reverse sort="mtime" limit=2 mtime ctime size small header}}
Result: