Plugin Attach
This Wiki Plugin displays an attachment or a list of attachments. It currently works with wiki pages and tracker items.Table of contents
Usage and Parameters
To use this plugin in a wiki page, use the syntax:Syntax for the ATTACH plugin
{ATTACH(name|file=>file.ext, page=>WikiPage, showdesc=>0|1, bullets=>0|1, image=>0|1, inline=>0|1, all=>0|1, num|id=> , dls=>0|1, icon=>0|1)} alternate hyperlink text specified with inline parameter {ATTACH}| Parameter | Accepted values | Default | Effect | Required? | Since |
|---|---|---|---|---|---|
| name or file | The file name of an attachment | none | Results in a link to the given file using the file name as the link text. Either name, file, id or num can be used to identify a single attachment. | n | |
| page | A wiki page name | none | Links to all files attached to this page will be listed | n | |
| showdesc | 0 or 1 | 0 | The description for the attachment will be used as the link text instead of the file name when set to 1 | n | |
| bullets | 0 or 1 | 0 | Creates a bullet list of the links to the attachment(s) when set to 1 | n | |
| image | 0 or 1 | 0 | Identifies the attachment as an image, which will be displayed inline using the img tag (see Wiki-Syntax Images) | n | |
| inline | 0 or 1 | 0 | Any text between the ATTACH tags will be used as the link text when set to 1. Only the first attachment will be listed. | n | |
| all | 0 or 1 | 0 | Lists links to all attachments for the entire tiki site together with pages they are attached to when set to 1 | n | |
| num | Number representing the order of an attachment in the list of attachments to a page. | none | Identifies the attachment to link to by order number instead of by file name. Either name, file, id or num can be used to identify a single attachment. | n | |
| id | Number representing the tiki id assigned to the attachment (visible in the list of attachments at the bottom of a page) | none | Identifies the attachment to link to by id number instead of by file name or order number. | n | |
| dls | 0 or 1 | 0 | The alt text that pops up on mouseover will include the number of downloads of the attachment at the end when set to 1 | n | |
| icon | 0 or 1 | 0 | A file type icon is displayed in front of the attachment link when this is set to 1 | n |
- Only files listed as an attachment at the bottom of a page are captured by this plugin.
- That means that images that have been uploaded through the "Upload picture:" option on the edit panel or uploaded to an image or file gallery and only linked to on the page will not be included. Other types of files (other than images) uploaded in the edit panel will be included because they appear in the list of attachments.
- To link directly to a single attachment, one (and only one) of the following parameters should be used: name, file, id, num
- To list attachments, use: page or all
- Performance problems in versions prior to 3.0 (fixed in 3.0):
- The bullets parameter doesn't appear to work
- The list produced with the all parameter is poorly formatted
- A patch for these problems can be found at http://dev.tikiwiki.org/tiki-view_tracker_item.php?itemId=2475
Examples
These examples use the attachments on this page. Expand the list of attachments at the bottom of this page to see how the attachment information is used or displayed in the following examples.Using icon, showdesc and dls parameters
This code,Using icon, showdesc and dls
{ATTACH(icon=>1, showdesc=>1, dls=>1)} {ATTACH}Would produce on this site:
Using Order Number and Custom Link Text
This code,Using order number and custom link text
{ATTACH(num=>2, icon=>1, dls=>1, inline=>1)}This is the second attachment to this page {ATTACH}Would produce on this site:
Using the ID Number and File Name
This code,Using the id number to identify the attachment
{ATTACH(id=>10, icon=>1, dls=>1)} {ATTACH}Would produce on this site:
