About FileDir
It is easy to display any type of files from a directory, filtering on the output type.
You can create a photo gallery or video, file archives.
Information
Released
October 10, 2013
Supported Database
MySQL
License
GPLv2
Supported Versions
2.2 - Current
Downloads
5,856
Instructions
Options:
&dir - path to the file folder by default - 'assets /'
&tpl - inner Tpl chunk, by default - 'tplFileDir'
Available placeholders:
[[+file]] - path to the file
[[+fname]] - the name of the file
[[+fdclass]] — class name depends on the file extension
[[+size]] - the file size
[[+fidx]] - the number of order
[[+date]] - creation date file
&tplOut - outer Tpl chunk, by default - 'tplFileDirOut'
Available placeholders:
[[+res_filedir]] - Required, do not delete!
[[+ftotal]] - The total number of files
&limit - maximum number of output files
&fcache - to enable the cache (false/true), the default - 'false'
&cachetime - the time of caching, default '0 ', to clear the cache
&filetip - types of output files (comma), by default - 'jpg,png,gif'
&sort - Enable or disable sorting (true or false, default - false)
&sortDir - sort direction (DESC or ASC, default - ASC)
&sortBy - name to sort (possibly: fname,file,fsize,date)
&class — prefix for the style in the template tpl, by default - 'fd', ie if the file
format is jpg, then placeholder [[+ fdclass]] in the template tpl bulet
output - fd_jpg. If we are in the carts snippets Specify & class = ``,
then displays the placeholder in the class extension - jpg.
Example snippet call:
[[!filedir? &dir = `assets/images/[[*id]]/`]]
[[!filedir? &dir = `assets/images/61/` &fcache =`true`]]
An example of a template for the gallery
< div >
< a href="[[+file]]" title="[[+fname]]" >
< img src="[[+file:rezimgcrop=`r-150x,c-150x75`]]" alt="[[+fname]]" >
< /a>
< /div >
An example of a template for the file archive
< div >
File: [[+fname]]
Size: [[+size]]
< a href="[[+file]]">Download< / a >
< /div >
You can use c expansion FileUpload
Example:
[[!FileUpload?
& uploadfields=`20`
& uploadgroups=`Administrator, Editors, Subadmins`
& path=`assets/images/[[*id]]`
!]]
New in 1.1.0-rc1
# November 10, 2013, version 1.1.0 rc1
[0007] Added sorting (https://github.com/artdevue/FileDir/issues/3)
[0008] Added placeholder Date (https://github.com/artdevue/FileDir/issues/2)
# December 26, 2012, version 1.0.0 rc1
[0006] In the template, you can specify a class for the file to be downloaded.
[0007] There was an option to call via getPage pagination.
# 18.03.2012
1) Improving code
2) Added an option &limit
3) Show the total number of files
4) Added a template tplOut
5) Files with a zero size ignoring