Loading...
 
Skip to main content
Display an attachment or a list of them

Plugin Attach

This wiki plugin displays an attachment or a list of attachments. It currently works with wiki pages and tracker items.

 Note
This plugin is very similar to PluginFile.

Parameters

Display an attachment or a list of them
Introduced in Tiki 1.
Go to the source code
Preferences required: feature_wiki_attachments, wikiplugin_attach

Parameters Accepted Values Description Default Since
(body of plugin) Comment
num Identifies the attachment to link to by the order of the attachment in the list of attachments to a page instead of by file name or ID. Either name, file, id or num can be used to identify a single attachment. 1
file text Same as name 1
id Identifies the attachment to link to by id number instead of by file name or order number. Either name, file, id or num can be used to identify a single attachment. 1
name text File name of the attached file to link to. Either name, file, id or num can be used to identify a single attachment 1
all (blank)
1
0
Lists links to all attachments for the entire tiki site together with pages they are attached to when set to 1 (Yes) 0 1
bullets (blank)
1
0
Makes the list of attachments a bulleted list (not set by default) 0 1
inline (blank)
1
0
Makes the text between the {ATTACH} tags the link text instead of the file name or description. Only the first attachment will be listed. 0 1
dls (blank)
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 (Yes) 0 1
icon (blank)
1
0
A file type icon is displayed in front of the attachment link when this is set to 1 (Yes) 0 1
image (blank)
1
0
Indicates that this file is an image, and should be displayed inline using the img tag (not set by default) 0 1
page pagename Name of the wiki page the file is attached to. If left empty when the plugin is used on a wiki page, this defaults to that wiki page. 1
showdesc (blank)
1
0
Shows the description as the link text instead of the file name (not used by default) 0 1

More tips on how the plugin works

  • 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):

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,

Copy to clipboard
{ATTACH(icon="1" showdesc="1" dls="1")} {ATTACH}


Would produce on this site:

 Right arrow
 Logo for TikiWiki doc site
 This is an example file attachment

This code,

Copy to clipboard
{ATTACH(num="2" icon="1" dls="1" inline="1")}This is the second attachment to this page {ATTACH}


Would produce on this site:
 This is the second attachment to this page

Using the ID Number and File Name

This code,

Copy to clipboard
{ATTACH(id="10" icon="1" dls="1")} {ATTACH}


Would produce on this site:

 arrow-right.png

Attached files

ID Name Comment Uploaded Size Downloads
10 arrow-right.png Right arrow lindon 273 b 5114
9 doctwo.png Logo for TikiWiki doc site lindon 34.97 Kb 2017
8 example_text_file.txt This is an example file attachment lindon 31 b 1838