yab_download
This tiny plugin allows you to offer a download of multiple files (per file id and/or category) with or without a confirmation button. Additionally you can offer an option to download all the files as zip archive on the fly. The names of the files are read from the files description. If no description is given the filenames are displayed.
Usage
This plugin has only one tag: <txp:yab_download />. You have to place it in an individual article.
The following attributes are available:
- files: The IDs of the files, which are for download (seperated by comma). If no files assigned with an ID an error message will displayed in the option field.
- label1: Label for select
- label2: Label for confirmation checkbox
- label3: Label for the submit input
- label4: Label for zip download checkbox
- notice: Error notice, if confirmation is not set but required
- size: Display filesize additionally (values are B, KB,MB, GB,PB).
- confirm : Form used with a confirmation checkbox (values: ‘1’ or some other string)
- formid: html id of the element form, used for anchor, if you use more than one
<txp:yab_download />in a single site, make different entries here; (defaultyab_cd_download) - cats: File categories you will add to download (seperated by comma); will additional displayed with files from
filesattribute above - exclude: IDs of the files you will exclude; Does only work with
catsattribute. - sort: Sort the files from
cats; (defauldescription asc) - zip: Offfers an checkbox with an option to download all offered files as zip instead (values: ‘1’ or some other string)
- zipname: the name of the offered zip (default all.zip)
Example usage
simple
<txp:yab_download files="1,2,3,4" />
full
<txp:yab_download files="1,2,3,4" label1="Choose your download" label2="Accept Download at your own risk" label3="Klick here for download" label4="Yeah give me all as zip" notice="You have to accept the condition below" size="MB" formid="form-no-1" confirm="1" cats="category1, category2" exclude="5,7" sort="filename desc" zip="1" zipname="archive.zip" />
The full example above will show you a form with two checkboxes. First one offers an option to download all the files zipped. The second checkbox is a confirmation checkbox.
The offered files will be the files with the file id #1, #2, #3, #4 and all files of the categories category1 and category2. If in category1 or category2 a file with the file id #5 and #7 so these will be excluded from download. The zipped file will be named as archive.zip.
Download
This download of the plugin shows you a real world example. So go to my plugin site, please!
Changelog
- 08-11-23 – v0.1
- release
- 08-11-27 – v0.2
- renamed the plugin to yab_download
- added: confirmation is now optional
- added: support files per categories
- added: sort per category
- added: files exclude
- added: zip-on-the-fly
- added: attribute formid for unique html ids for multiple plugin usage per page
- 08-12-01 – v0.3
- bugfix: filesize of category listing will now correctly calculated
- bugfix: minor code improvement
- 08-12-21 – v0.4
- bugfix: code improvement (Thanks to Geoffrey in my weblog comments)









If there is a comment form at the Information URL, you may want to leave your comments/questions there or at the Forum thread for quicker feedback. Otherwise, comment away:
Subscribe to this article's comments RSS feed. [ ? ] View Recent Comments across the site. Get a Gravatar.