{"id":23631185,"url":"https://github.com/philecms/philefolderloop","last_synced_at":"2025-10-27T22:42:43.392Z","repository":{"id":74330423,"uuid":"20809849","full_name":"PhileCMS/phileFolderLoop","owner":"PhileCMS","description":"Loop through a folder of files with Twig","archived":false,"fork":false,"pushed_at":"2014-06-13T16:09:12.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-28T02:48:50.405Z","etag":null,"topics":["philecms-plugin"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhileCMS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-13T16:06:48.000Z","updated_at":"2018-03-15T13:41:30.000Z","dependencies_parsed_at":"2023-02-25T23:00:22.689Z","dependency_job_id":null,"html_url":"https://github.com/PhileCMS/phileFolderLoop","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhileCMS%2FphileFolderLoop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhileCMS%2FphileFolderLoop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhileCMS%2FphileFolderLoop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhileCMS%2FphileFolderLoop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhileCMS","download_url":"https://codeload.github.com/PhileCMS/phileFolderLoop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239552001,"owners_count":19657821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["philecms-plugin"],"created_at":"2024-12-28T02:48:57.643Z","updated_at":"2025-10-27T22:42:38.371Z","avatar_url":"https://github.com/PhileCMS.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"phileFolderLoop\n===================\n\nLoop through a folder of files with Twig\n\n### 0.9.*\n\nThis version currently works with 0.9.\\*. I havent built the 1.\\* version yet!\n\n### Installation\n\n* Install [Phile](https://github.com/PhileCMS/Phile)\n* Clone this repo into `plugins/phileFolderLoop`\n* add `$config['plugins']['phileFolderLoop'] = array('active' =\u003e true);` to your `config.php`\n\n### Usage\n\nIn the config there is a list of acceptable file types. The default is for images, so it looks like this:\n\n```\n'image_types' =\u003e 'jpg|jpeg|svg|png|gif|webp|ico|bmp'\n```\n\nYou can change this to match the type of files that you want to show.\n\nThere 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.\n\nExample:\n\n```twig\n\u003cdiv class=\"grid photo-loop\"\u003e\n  {% set images = loop('content/images/products') %}\n  {% for image in images %}\n    \u003cdiv class=\"col-1-2\"\u003e\n      \u003ca href=\"{{ image.url }}\" data-count=\"{{ image.id }}\" target=\"_blank\"\u003e\n        \u003cimg src=\"{{ image.url }}\" width=\"{{ image.width }}\" height=\"{{ image.height }}\" alt=\"{{ image.name }}\"\u003e\n      \u003c/a\u003e\n    \u003c/div\u003e\n  {% endfor %}\n\u003c/div\u003e\n```\n\nOutput:\n\n```html\n\u003cdiv class=\"grid photo-loop\"\u003e\n  \u003cdiv class=\"col-1-2\"\u003e\n    \u003ca href=\"content/images/products/IMG_7044.jpg\" data-count=\"0\" target=\"_blank\"\u003e\n      \u003cimg src=\"content/images/products/IMG_7044.jpg\" width=\"522\" height=\"348\" alt=\"IMG_7044\"\u003e\n    \u003c/a\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilecms%2Fphilefolderloop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilecms%2Fphilefolderloop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilecms%2Fphilefolderloop/lists"}