I want to list all files in a directory Using PyroCMS.
Using the Files module each client has their own folder, the folder is their User ID
\files\clients\{ID}\
I need something like this.
{{ foreach file in { files:/clients/{{ user:id }} } }}
<a href="{{files:current_file_name_and_ext}}">{{files:current_file_name}}</a>
{{ endif }}
You should be able to do something like this…
You will need to set the client_id variable though. You could set it in your contoller and use:
Or even use the current user with the tag:
I haven’t tested this, but you should be able to get something going.
From here:
http://docs.pyrocms.com/2.1/manual/index.php/modules-and-tags/tag-reference/files
http://docs.pyrocms.com/2.1/manual/index.php/modules-and-tags/tag-reference/user