# (:attachlist:) command

## Purpose and Syntax

The wiki command (:attachlist:) is designed to insert a list of attachments into a wiki page:
(:attachlist [params...]:)
The following parameters can be used with the (:attachlist:) command to customize the list:

- sort — specifies the file sorting order. This parameter accepts the following values:

- name — files are sorted by name in ascending order (default, equivalent to using the command without parameters);
- descendname — files are sorted by name in descending order;
- ext — files are sorted by extension in ascending order;
- descendext — files are sorted by extension in descending order;
- size — files are sorted by size in ascending order;
- descendsize — files are sorted by size in descending order;
- date — files are sorted by last modification date in ascending order;
- descenddate — files are sorted by last modification date in descending order;

- subdir — allows displaying attachments located in subfolders.

## Examples

This page has five attached files and a directory named subfolder containing several more files. Below are results of the (:attachlist:) command with various parameter values:

Command | Result
--- | ---
(:attachlist:) | Вложения subfolder anchor.png first.jpg image.gif image.jpg image.png
(:attachlist sort=ext:) | Вложения subfolder image.gif first.jpg image.jpg anchor.png image.png
(:attachlist sort=descendext:) | Вложения subfolder image.png anchor.png image.jpg first.jpg image.gif
(:attachlist sort=size:) | Вложения subfolder anchor.png first.jpg image.jpg image.gif image.png
(:attachlist subdir="subfolder":) | subfolder feed.gif first.jpg icon.jpeg new.png open.png
(:attachlist subdir="subfolder" sort=descendname:) | subfolder open.png new.png icon.jpeg first.jpg feed.gif

See also:

- Wiki commands
- (:childlist:) command
- Attachments and images