| 1 |
=== Document Gallery === |
| 2 |
Contributors: dan.rossiter |
| 3 |
Tags: attachments, icons, documents, gallery, ms office, doc, ppt, xls, docx, pptx, xlsx, pdf, openoffice |
| 4 |
Requires at least: 2.6 |
| 5 |
Tested up to: 3.5 |
| 6 |
Stable tag: 1.2 |
| 7 |
License: GPLv2 or later |
| 8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html |
| 9 |
|
| 10 |
This plugin allows the user to easily create a "gallery" of all non-image attachments on a given post/page, |
| 11 |
making them easy to share. |
| 12 |
|
| 13 |
== Description == |
| 14 |
|
| 15 |
This plugin allows the user to effortlessly include a gallery, much like a photo gallery, |
| 16 |
of all your non-image attachments anywhere within your post. |
| 17 |
|
| 18 |
The plugin will, by default, inherit the styling within your active theme, but with a |
| 19 |
little CSS knowledge it is easily modified to meet your specific needs. |
| 20 |
|
| 21 |
Read more in the **Installation** tab! |
| 22 |
|
| 23 |
*If this plugin has helped you, please take a moment to |
| 24 |
[rate it](http://wordpress.org/support/view/plugin-reviews/document-gallery#postform)!* |
| 25 |
|
| 26 |
== Installation == |
| 27 |
|
| 28 |
1. Upload `document-gallery` to the `/wp-content/plugins/` directory |
| 29 |
1. Activate the plugin through the 'Plugins' menu in WordPress |
| 30 |
1. Place `[dg]` in any posts or pages you want a document gallery included. See below for additional display options. |
| 31 |
|
| 32 |
= Document Gallery Options = |
| 33 |
|
| 34 |
In order to include all compatible docuements from a given page or post, you must include |
| 35 |
the following shortcode in the post: |
| 36 |
|
| 37 |
`[dg descriptions=[true/false] orderby=[menu_order, title, date, author, rand] order=[ASC/DEC] |
| 38 |
attachment_pg=[true/false] images=[true/false] ids=[false/comma-separated list of id #s]]` |
| 39 |
|
| 40 |
**Default Values** |
| 41 |
|
| 42 |
By default, document gallery will use `descriptions=false`, `orderby=menu_order`, `order=ASC` |
| 43 |
, `attachment_pg=false`, `images=false`, and `ids=false` if you do not specify otherwise. |
| 44 |
|
| 45 |
**Descriptions Option** |
| 46 |
|
| 47 |
If `true`, each document will take its own line with the description displayed alongside it. |
| 48 |
|
| 49 |
*Note: this will use the `description` field, **not** the `caption`. Be careful when entering |
| 50 |
your document data.* |
| 51 |
|
| 52 |
**Orderby Option** |
| 53 |
|
| 54 |
* `menu_order` - This is probably the one you want to use. Order by the integer fields in the Insert / |
| 55 |
Upload Media Gallery dialog. Note that these fields may be blank by default. If this is the case, |
| 56 |
you must populate the fields before this option will work. |
| 57 |
* `title` - Alphabetical order based on title. |
| 58 |
* `date` - Order by date of document upload. |
| 59 |
* `author` - Order by the owner of the upload (username). |
| 60 |
* `rand` - Pseudo-random order. |
| 61 |
|
| 62 |
**Order Option** |
| 63 |
|
| 64 |
This option works alongsied the `orderby` option to determine whether the documents are displayed in |
| 65 |
ascending or decending order. |
| 66 |
|
| 67 |
**Attachment Page Option** *(New in Version 1.1)* |
| 68 |
|
| 69 |
This option determines whether each document icon will link to the actual file or to its attachment page. |
| 70 |
If you want the user to be able to click on the icon and directly rective the option to download then |
| 71 |
use `attachment_pg=false` (the default). If you have information on the attachment page that you want the |
| 72 |
link to go to, use `attachment_pg=true`. |
| 73 |
|
| 74 |
**Images** *(New in Version 1.2)* |
| 75 |
|
| 76 |
This option will tell the plugin to pull all images attached to to a page or post in addition to all documents. |
| 77 |
|
| 78 |
**Ids** *(New in Version 1.2)* |
| 79 |
|
| 80 |
This is an advanced option intended for experienced WordPress users. If this option is used, the plugin will |
| 81 |
ignore attached documents, instead including all attachments defined by the ids attribute (e.g.: `ids=10,2,4,42`). |
| 82 |
|
| 83 |
*Note: If this attribute is used, the `order`, `orderby`, and `images` attributes will be ignored. Order is defined |
| 84 |
by the order the ids are provided.* |
| 85 |
|
| 86 |
= Customize Appearance = |
| 87 |
|
| 88 |
By default, the document gallery will use the styles within your active theme to handle most of the appearance, |
| 89 |
but, with a little CSS knowledge, you can customize pretty much anything about how it looks. See |
| 90 |
[`style.css`](http://plugins.svn.wordpress.org/document-gallery/trunk/style.css) for an idea of what will |
| 91 |
select different elements within the gallery display. |
| 92 |
|
| 93 |
**Example** |
| 94 |
|
| 95 |
Say I would like to include a border for the right and bottom of thedocument icon, but only when descriptions |
| 96 |
are shown (to deliniate the icon from the description text). To do this, I would need to add the following |
| 97 |
CSS to my theme stylesheet: |
| 98 |
|
| 99 |
`.document-icon-wrapper.descriptions .document-icon{ |
| 100 |
border-right: 1px solid #37824A; |
| 101 |
border-bottom: 1px solid #37824A; |
| 102 |
}` |
| 103 |
|
| 104 |
Now, if I wanted to modify that code to instead add the same border to all of the document-icons, regardless of |
| 105 |
whether they have a description or not, I would just change the first line, removing the descriptions class like so: |
| 106 |
|
| 107 |
`.document-icon-wrapper .document-icon` |
| 108 |
|
| 109 |
*NOTE: Please don't modify the plugin stylesheet directly or your changes will be lost when a new version is released.* |
| 110 |
|
| 111 |
= Theme Developers = |
| 112 |
|
| 113 |
If you would like to include Document Gallery functionality in your theme, you simply need to include the following |
| 114 |
code wherever you would like it to appear: `<?php echo do_shortcode('[dg]'); ?>`. You can include additional options |
| 115 |
(listed above) as needed. |
| 116 |
|
| 117 |
== Screenshots == |
| 118 |
|
| 119 |
1. This is how the Document Gallery looks with `descriptions=false` (default). Note that the display inherits styling from your active theme. |
| 120 |
2. This is how the Document Gallery looks with `descriptions=true`. The descriptions are auto-populated using the description field from when you upload the document. |
| 121 |
|
| 122 |
== Changelog == |
| 123 |
|
| 124 |
= Coming (Relatively) Soon = |
| 125 |
|
| 126 |
* Full integration with the new [Wordpress 3.5 Media Manager](http://codex.wordpress.org/Version_3.5#Highlights). |
| 127 |
* Option to include player for any music or video attachments uploaded to page. |
| 128 |
* Option to open documents directly within your browser (à la [Google Drive Viewer](https://drive.google.com/viewer)). |
| 129 |
* Support for adding your own filetypes/icons. |
| 130 |
* Whatever else **you** would like (post on the [support forum](http://wordpress.org/support/plugin/document-gallery) if you have ideas)! |
| 131 |
|
| 132 |
= 1.2 = |
| 133 |
|
| 134 |
* **New Feature:** Images can now be included alongside documents in a document gallery (using `images=true` attribute). |
| 135 |
* **New Feature:** Attachment ids can now be explicitly listed, allowing for documents not attached to a post or page |
| 136 |
to be included in a document gallery (e.g.: `ids=2,42,57,1`). Note that no spaces should be included. |
| 137 |
* **Enhancement:** The CSS stylesheet has been enhanced for more flexibility in sizing icons. |
| 138 |
|
| 139 |
= 1.1 = |
| 140 |
|
| 141 |
* **New Feature:** Included option to link to the attachment page as well as to the actual document. |
| 142 |
* **Enhancement:** Added documentation for customizing the appearance of the plugin. |
| 143 |
* **Enhancement:** Many improvements to the backend, including pretty HTML output and best practice implementation in |
| 144 |
calls to WordPress core functions. |
| 145 |
|
| 146 |
= 1.0.4 = |
| 147 |
|
| 148 |
* **Bug Fix:** Removed extra `div` at bottom when number of documents is evenly divisible by 4. (Thanks, joero4ri!) |
| 149 |
|
| 150 |
= 1.0.3 = |
| 151 |
|
| 152 |
* **Bug Fix:** Resolved issue with detecting plugin directory. (Thanks, Brigitte!) |
| 153 |
* **Enhancement:** Minor improvement to how linking to individual documents is handled. |
| 154 |
|
| 155 |
= 1.0.2 = |
| 156 |
|
| 157 |
* **Bug Fix:** Merge for changes in 1.0 did not go through correctly so users downloaded the old icon set which broke the functioning. Sorry about that, but |
| 158 |
all is resolved with this release! |
| 159 |
|
| 160 |
= 1.0.1 = |
| 161 |
|
| 162 |
* **Bug Fix:** Resolved issue with long document titles being cut off in some themes. |
| 163 |
|
| 164 |
= 1.0 = |
| 165 |
|
| 166 |
* **Enhancement:** Optimized gallery generation (faster!) |
| 167 |
* **Enhancement:** Plugin now has **36 icons** representing **72 filetypes**! |
| 168 |
* **Enhancement:** Added fallback to WordPress default icons if you happen to include one of the few filetypes not yet supported. |
| 169 |
* **Enhancement:** Changed shortcode to `[dg]` (`[document gallery]` will still work for backward compatibility). |
| 170 |
* **Enhancement:** Gave documentation some **much needed** revisions. |
| 171 |
|
| 172 |
= 0.8.5 = |
| 173 |
|
| 174 |
* **Enhancement:** Added support for [OpenDocuments](http://en.wikipedia.org/wiki/OpenDocument). |
| 175 |
|
| 176 |
= 0.8 = |
| 177 |
|
| 178 |
* **Release:** First public release of Document Gallery. |
| 179 |
* **Feature:** Displays PDF, Word, PowerPoint, Excel, and ZIP documents from a given page or post. |
| 180 |
* **Feature:** Documents can be ordered by a number of different factors. |
| 181 |
|