Screen shot 2010-10-22 at 10.42.59 AM.png

File Tree is an input filter which renders a list of files into an nice-looking, interactive tree of files. It uses a very small (<2kb) Javascript file to expand and collapse the folders, with pretty icons mapped to different file types.

Usage

Enable the module, and add File Tree to your text formats. Then, enter [filetree dir="some-directory"] into the body field of a node, and it will render a list of all the files in that folder. (Note, the folder must reside in your site's "files" folder.)

Security

To explicitly define which folders may be rendered, visit your text format's configuration form. There you may define your allowable folder paths (by default, all folders in your file system path are allowed).

Requirements

The D7 version has no additional requirements. The D6 version requires Token.

.descript.ion support

The 2.0 branch added .descript.ion file support. You can now have a .descript.ion file in your directory which gives longer (or alternative) descriptions to your files (which helps if you're on a system with filename limits). See #1184560: Parse descript.ion file for metainformation for more information.

Options

multi
When enabled, allows more than one folder to be open at the same time. Enabled by default.
Example: [filetree dir="some-directory" multi="false"]
controls
When enabled, adds links to expand and collapse all levels of the tree. Enabled by default. Automatically disabled if "multi" is true.
Example: [filetree dir="some-directory" controls="false"]
absolute
When enabled, formats links to files with absolute URLs. Enabled by default.
Example: [filetree dir="some-directory" absolute="false"]
exclude
When defined, excludes certain paths. By default, "CVS" paths are excluded.
Example: [filetree dir="some-directory" exclude="CVS; directory1; *.css"]
dirname, dirtitle, filename, filetitle
When defined, formats the name or title of directories or files. Available tokens: %filename, %basename, %extension, %size, %created, %modified. In Drupal 7, a File Tree date format is used to format the %created and %modified tokens (see admin/config/regional/date-time). Defaults to "%filename".
Example: [filetree dir="some-directory" dirtitle="Click to toggle." filename="%basename" filetitle="Click to download this %extension file."]
fileformat
When defined, formats file list items. In addition to the tokens above, a %link token is available, which is the rendered filename token. Defaults to "%link".
Example: [filetree dir="some-directory" fileformat="%link - %size"]
animation
When enabled, folders will expand and collapse with a fast animation. Set to false if large file trees are causing slow hang-ups. Enabled by default.
Example: [filetree dir="some-directory" animation="false"]

Similar modules

Project Information

Downloads