WordPress.org

Ready to get started?Download WordPress

Plugin Directory

EG-Attachments

This plugin add a shortcode to display the list of attachments of a post, with icon and details. EG-Attachments is "TinyMCE integrated".

Automatic installation

1.Log into your WordPress admin 2.Click Plugins 3.Click Add New 4.Search for EG-Attachments 5.Click Install Now under "EG-Attachments" 6.Activate the plugin

Manual installation:

1.Download the plugin 2.Extract the contents of the zip file 3.Upload the contents of the zip file to the wp-content/plugins/ folder of your WordPress installation 4.Then activate the Plugin from Plugins page

The plugin is now ready to be used. You can also install the plugin directly from the WordPress interface.

Then you can go to menu Settings / EG-Attachments to set plugin parameters

Usage

Four ways to include the list of attachments into a post: * With the paper clip button in TinyMCE bar. Click on this button, choose the options, and click insert, * With the shortcode [attachments options ] * With the automatic shortcode: go to the Settings / EG-Attachments, and choose to activate the auto-shortcode. The list of attachments will be added to your post automatically. * In a template file, add the following code: <?php do_shortcode('[attachments *options*]'); ?>

The shortcode options are:

  • template: if the parameter size is set to custom, the template is designing the template to be used to display attachments
  • doctype: type of documents to display. Values: image or document. Defaults: document,
  • id: id of the post we want to display attachments. Possible values: id of a post, 0 for the current post, -1 to display attachments that are not attached to the current post. Default value: 0,
  • include: list of attachments' id (comma separated) you want to display. Default: nothing, to display all attachments. This option is not supporting the value first, and end supported previously by docid,
  • exclude: list of attachments's id to exclude from the list,
  • orderby: sort option. Values: title, caption, description, file name, size, date, type, menu_order and ASC or DESC. ASCis the default sort order. Default: title ASC.
  • title: title to display before the list. Default: '',
  • titletag: tag to add before and after the title. Default: h2
  • 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.
  • limit: choose the number of attachements you want to display. Default: all attachments are displayed
  • nofollow: add the attribut "nofollow" to the link, if value is set to 1 or TRUE. Default nofollow=0
  • logged_users authorizes access to the file, to logged users only, or to all users. Possible values: 0, all users can visualize or download attachments, and 1, only logged users can access to attachments. Default value: the default value is defined in the Settings page in administration interface.
  • tags allows you to select attachments according tags (post tags). Syntax: tags=tag1,tag2. The shortcode will display attachments with either tag1 or tag2,
  • tags_and allows to select attachments linked to all tags specified. Syntax: tags_and=tag3,tag4. The attachments displayed are linked to tag3 AND tag4.

Depredicated options

  • size: size of the icon. Values: large, medium, small or custom. Default: large,
  • docid list of attachments' id (comma separated) you want to display. Default: empty value, if you want to display all attachments. This parameter is replaced by include

In the old posts, shortcodes using size and docid are still working, these two parameters are emulated using the new parameters template and include. In future posts, please use template and include parameters.

Remove options:

  • fields, list of fields to display. Values: Document label, Title, Caption, Description, File name, Size, Small size, Date, Type, or a set of values such as "caption,description" (comma separated).
  • icon specify if icons will be displayed or not. Default value: 1 or TRUE. If value is 0 or FALSE, list displayed will be ul/li (html simple list) rather than dl/dt/dd (definition list).
  • display_label: for size=small only. Allow to display label of fields, when value is set to 1. Default display_label=0
  • label label of each document. Values: filename, doctitle. Default: filename. Option available for size=small or size=medium only.

These parameters don't work even in existing posts. But you can easily get the results you want, by modifying templates.

** Examples :**

*1: [attachments template=medium doctype=document title="Attachments" titletag=h2 orderby="title"] *2: [attachments template=large title="Documents" titletag=h3 orderby="mime DESC"] *3: [attachments title="Books and DVD Reviews" orderby="date DESC" tags="books,dvd" id=-1]

Some explanations about *General behavior of shortcodes

In the menu Settings / EG-Attachments, you will find a section named General behavior of shortcodes. The options in the section are

  • applied to all shortcodes (automatic or manually inserted into posts),
  • used as options for the automatic shortcode,
  • used as default value for the shortcode manually inserted into posts.

Example: if you check the option Force "Save As" when users click on the attachments, you force download for all attachments displayed by auto-shortcodes, and manual shortcode, except if you specify force_saveas in a shortcode option.

Statistics

Just activate the clicks counter in the menu Settings / EG-Attachments, and then go to the menu Tools / EGA statistics to see how many clicks you have, for each document.

The graphs are using Google chart tools, and then, require an intenet connection. If you are using internet through a proxy or a firewall, you may encountered some issues to display graphes properly.

Requires: 3.5.0 or higher
Compatible up to: 3.9.0
Last Updated: 2014-4-15
Downloads: 41,101

Ratings

4 stars
4.7 out of 5 stars

Support

0 of 2 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1
100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,1,1
0,1,0 100,2,2 100,1,1 100,1,1
50,2,1 100,1,1
100,4,4 100,1,1 100,1,1 100,1,1
100,1,1 67,3,2 100,1,1 100,1,1
100,1,1 100,4,4
0,1,0
100,2,2 100,1,1
100,1,1
100,1,1
100,1,1 100,1,1
100,1,1
100,1,1 50,2,1 100,1,1
100,2,2 50,2,1 100,2,2 100,1,1 100,1,1 100,3,3 100,1,1 50,2,1 75,4,3
100,3,3 100,1,1 100,1,1 100,1,1
50,2,1 100,2,2 100,3,3 75,4,3 67,3,2 100,2,2
100,1,1
100,1,1
100,1,1
100,3,3 100,1,1
100,1,1 100,1,1 100,1,1
100,2,2
100,1,1
100,1,1
50,6,3 50,2,1 100,1,1
100,1,1 100,1,1
100,2,2
100,1,1
100,1,1
100,1,1