EG-Attachments adds a shortcode to display the list of attachments of a post. WordPress allows to attach files to a post, but it doesn’t provide any features to display these files. EG-Attachments displays attachments as you want: you can choose the attachments you want to display, choose the size of icons, … The list can contain information such file type, file size, title …

Description

EG-Attachments add a new shortcode [ attachments]. This shortcode can be used with many options.
But you don’t need to know all of these options, because the plugin is “TinyMCE integrated” : from the post editor, just click on the EG-Attachments button, and a window allows you to choose documents to display, title of the list, size of icons … Nothing to learn.

TinyMCE integrated

TinyMCE integrated

Shortcode configuration

Shortcode configuration

This button is only available with  WordPress 2.7 and above.

You can insert the shortcode by hand if you want, or use it in a template using the do_shortcode function. You can use also the function Auto shortcode, available since version 1.2.0. This function allows you to add automaticaly the list of attachments in each post, without using shortcode or template tag. This option can be activated in the settings page.

Installation

  1. The plugin is available for download on the WordPress site,
  2. Once downloaded, uncompress the file eg-attachments.zip,
  3. Copy or upload the uncompressed files in the directory wp-content/plugins in your WordPress platform
  4. Activate the plugin, in the administration interface, through the menu Plugins

The plugin is now ready to be used.

You can also use the WordPress 2.7 features, and install the plugin directly from the WordPress interface.

You can download this plugin with the WordPress plugin repository.

Usage

EG-Attachments can be used:

  • in a post, where you can insert the shortcode [ attachments <options>],
  • in a template file (during a theme development), you can insert the following code

shortcode’s options are:

  • size: size of the icons. Possible values are large, medium, or small. Default value is Small,
  • docid: comma separated list of the attachments’ ids. Default value: nothing, display all attachments. You can use also two keywords, first and last to display only the first or only the last item.
  • orderby: Sort key. Possible values are ID or post_title, but also ASC et DESC. Default value is post_title ASC,
  • title: Title displayed before the list. This option is not mandatory. The default value is ”,
  • titletag: HTML tag to be used with title value. Default value is h2,
  • label: choice of document label. Possible values: filename or doctitle. Default value: filename,
  • force_saveas forces the browser to show the dialog box (Run / Save as) rather than display attachment. Values: true or false. Default: the default value is defined in the Settings page in administration interface.

Exemples

Small size

Small size

Medium size

Medium size

Large Size

Large Size

Options page

Options page

Advanced usage

You can modify the list style, by modifying the eg-attachments.css style sheet.
This stylesheet is stored in the root directory of the plugin. But you can create a file with the same name in your template directory.

To modify the existing icons, or modify some of them, you can modify or add bitmap files in <PLUGINDIR>/eg-attachments/images directory.