https://github.com/philecms/philefolderloop
Loop through a folder of files with Twig
https://github.com/philecms/philefolderloop
philecms-plugin
Last synced: 8 months ago
JSON representation
Loop through a folder of files with Twig
- Host: GitHub
- URL: https://github.com/philecms/philefolderloop
- Owner: PhileCMS
- License: mit
- Created: 2014-06-13T16:06:48.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-13T16:09:12.000Z (about 12 years ago)
- Last Synced: 2024-12-28T02:48:50.405Z (over 1 year ago)
- Topics: philecms-plugin
- Language: PHP
- Size: 105 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
phileFolderLoop
===================
Loop through a folder of files with Twig
### 0.9.*
This version currently works with 0.9.\*. I havent built the 1.\* version yet!
### Installation
* Install [Phile](https://github.com/PhileCMS/Phile)
* Clone this repo into `plugins/phileFolderLoop`
* add `$config['plugins']['phileFolderLoop'] = array('active' => true);` to your `config.php`
### Usage
In the config there is a list of acceptable file types. The default is for images, so it looks like this:
```
'image_types' => 'jpg|jpeg|svg|png|gif|webp|ico|bmp'
```
You can change this to match the type of files that you want to show.
There will now be a new twig function called `loop`. It takes a path to a folder (relative to the ROOT_DIR, your root installation directory) and grabs all the images in there.
Example:
```twig
```
Output:
```html
```