NAME App::ZofCMS::Plugin::FileList - ZofCMS plugin to display lists of files SYNOPSIS In your Main Config file or ZofCMS template: plugins => [ qw/FileList/ ], plug_file_list => { list => { list1 => 'pics', list2 => 'pics2', }, }, In your HTML::Template template:
DESCRIPTION Module is a App::ZofCMS plugin which provides means to display lists of files. This documentation assumes you've read App::ZofCMS, App::ZofCMS::Config and App::ZofCMS::Template MAIN CONFIG FILE OR ZofCMS TEMPLATE FIRST-LEVEL KEYS "plugins" plugins => [ qw/FileList/ ], You would definitely want to add the plugin into the list of plugins to execute :) "plug_file_list" plug_file_list => { name => 0, re => qr/[.]jpg$/i, list => { list1 => 'pics', list2 => [ qw/pics2 pics3/ ], }, }, plug_file_list => { list => [ qw/pics pics2/ ], }, plug_file_list => { list => 'pics', }, You can specify the "plug_file_list" first-level key in either Main Config File or ZofCMS Template file. Specifying the same keys in both will lead to the ones set in ZofCMS Template take precedence. The "plug_file_list" key takes a hashref as a value. Possible keys/values of that hashref are as follows: "list" plug_file_list => { list => { list1 => 'pics', list2 => [ qw/pics2 pics3/ ], }, }, plug_file_list => { list => [ qw/pics pics2/ ], }, plug_file_list => { list => 'pics', }, The "list" key specifies the directories in which to search for files. The value of that key can be either a hashref, arrayref or a scalar. If the value is not a hashref it will be converted into a hashref as follows: plug_file_list => { list => 'pics', # a scalar }, # same as plug_file_list => { list => [ 'pics' ], # arrayref }, # same as # hashref with a key that has a scalar value plug_file_list => { list => { plug_file_list => 'pics', } }, # same as # hashref with a key that has an arrayref value plug_file_list => { list => { plug_file_list => [ 'pics' ], } }, The hashref assigned to "list" (or converted from other values) takes the following meaning: the keys of that hashref are the names of the keys in "{t}" ZofCMS Template special key and the values are the lists (arrayrefs) of directories in which to search for files. See SYNOPSIS section for some examples. Note that default "{t}" key would be "plug_file_list" as is shown in conversion examples above. "re" plug_file_list => { re => qr/[.]jpg$/i, list => 'pics', }, Optional. The "re" argument takes a regex as a value ("qr//"). If specified only the files that match the regex will be listed. By default is not specified. "name" plug_file_list => { name => 0, list => 'foo', }, Optional. Takes either true or false values, specifies whether or not to create the "name" "