EEConf 2024 is around the corner! EEConf 2024
I’m using the native file manager. I have a folder the has multiple sub directories within it and files. I want to show a list of all files, as well as organize them to what directory they’re in. Basically showing the same structure on the front-end as the file directory structure in EE.
I’m running 7.3.15.
{exp:file:entries limit="100" paginate="both" directory_id="11" dynamic="no" sort="desc"}
<strong><a href="http://{file_url}" target="_blank" rel="noopener">{title}</a></strong>
{directory_title}
{paginate}
Page {current_page} of {total_pages} pages {pagination_links}
{/paginate}
{/exp:file:entries}
I’m not sure the file module can do what you’re wanting.
Is it more you want to show the directory structure?
blog – blog_news – blog_code
Where the above are folders/subfolders? And maybe show the entries in each folder as well?
The file entries tag is going to show the individual files. It can show their directory info, but I don’t think you can get from the entries to the directory structure. Not in any way I’d want to try and do with the tags.
But- am I understanding what you’re going for or totally in left field?
I actually got what i wanted by using this code with the Assets Add-on. Not sure the file module is capable.
<ul>
{exp:assets:folders}
<li>
<h1> {folder_name} </h1>
{if total_subfolders > 0}
{exp:assets:files folder_id="{folder_id}"}
{url}
{/exp:assets:files}
<ul>
{subfolders}
</ul>
{/if}
{if total_subfolders == 0}
{exp:assets:files folder_id="{folder_id}"}
{url}
{/exp:assets:files}
{/if}
</li>
{/exp:assets:folders}
</ul>
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.