Git Product home page Git Product logo

filedir's Introduction

FileDir (MODX Revolution)

========= ** 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.


Donwload MODX extras

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:

```php[[!filedir? &dir = `assets/images/[[*id]]/`]]
[[!filedir? &dir = `assets/images/[[*id]]/`]]
[[!filedir? &dir = `assets/images/61/` &fcache =`true`]]
```
  • An example of a template for the gallery

      <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

      File: [[+fname]]
      Saze: [[+size]]
      <a href="[[+file]]">Download</a>
    </div>
    <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]]
      Saze: [[+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]]`
    !]]```
    ```html
    < div >
      File: [[+fname]]
      Size: [[+size]]
      <a href="[[+file]]">Download</a>
    < /div >```
    
    ```html
    <div>
      File: [[+fname]]
      Size: [[+size]]
      <a href="[[+file]]">Download</a>
    </div>```

Authors

Valentin Rasulov
artdevue.com
http://artdevue.com

filedir's People

Contributors

artdevue avatar

Watchers

James Cloos avatar Aliaksandr Pinchuk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.