Wiki {{download}} macro¶
Since version 0.0.3 the plugin supports the !{{download}}
Wiki macro.
Arguments¶
The following arguments are supported:
Label¶
You can override the default label of the button (which is “Download” unless another label is specified in project settings) using:
!{{download(label=Get)}}
Package¶
Download Download plugin 0.1.0
You can also override the package (which is a project name by default):
!{{download(package=Download plugin)}}
Project¶
Download Sidebar Content 0.1.2
By default the macro uses the current project but you can create a cross-project "Download" button by specifying an identifier of another project:
!{{download(project=redmine-sidebar)}}
See the Sidebar Content plugin.
File¶
You can specify a file for your Wiki "Download" button. There are two methods to do this:
Using file ID¶
Download Pre-patched RHTML files for 0.0.3
!{{download(project=redmine-like,file_id=229,package=Pre-patched RHTML files for)}}
See Files section of the Like Button plugin.
Using file name¶
Download Pre-patched RHTML files for 0.0.3
!{{download(project=redmine-like,file=pre-patched-rhtml-1.0.x.tar.bz2,package=Pre-patched RHTML files for)}}
The "Download" button plugin will search for the file name in the project or in the particular version if version=
was specified.
See Files section of the Like Button plugin.
Version¶
Version is detected automatically when you specify a file (unless it's used to limit the search scope for file=
). You may need to specify a version when a file should be autodetected or to limit the search scope for file=
. This can be done in two ways:
Using version ID¶
Download Download Button 0.0.1
!{{download(version_id=32)}}
Using version number¶
Download Download Button 0.0.2
!{{download(version=0.0.2)}}
include_version=true
for such buttons.Including version¶
Download Download Button 0.0.2
To show or to hide a version on a button you can use include_version=
:
!{{download(version=0.0.2,include_version=true)}}
include_version=true
if you specify a version explicitly.External URL¶
Download Download Button 0.1.0
External URL can be specified this way:
!{{download(url=http://www.redmine.org/plugins/download)}}
Enabling¶
If you don't like the default placement of the button (top of sidebar) you can disable the button in project settings and place it where you want using Wiki. In this case you will find enable=
argument useful. It overrides the "disabled" property:
!{{download(enable=true)}}
enable=false
is also supported but has no sense.Class¶
Wiki "Download" buttons can be styled in a different way using class=
argument. This argument specifies the CSS class name which will be added to a "Download" button:
!{{download(class=old-version)}}
Produces HTML code:
<a href="/attachments/download/.../...tar.bz2" class="download old-version">
<span class="icon-download">
Download
<span class="version">Download Button x.x.x</span>
</span>
</a>
Aligning¶
Another style argument align=
allows to align the "Download" button either to the "left" or to the "right":
!{{download(align=right)}}
All sample buttons on this page use align=right
.
Limitations¶
url=
and version=
arguments cannot be used concurrently - version=
will override url=
! However the solution exists: Override package by specifying the version explicitly:
!{{download(url=http://www.redmine.org/plugins/download,package=Button 0.0.2,include_version=false)}}
ChiliProject 3.0¶
ChiliProject starting from version 3.0 supports different style of macros: instead of !{{download}}
you should be using {% download %}
.