2

After getting files properly indexed on the backend, how can they be displayed through a template on the front-end using the two assets:folders and assets:files?

If the file structure looks like this on the server:
Folder A
- file1
- file2
- Folder B
-- file3
-- file4
--- Folder C
---- file5
---- file6

... and was indexed with Assets, using their tags how could I display that in an unordered nested list? Th example on their site with folders and files is close, but isn't nested. The end goal is a browsable download page with EE goodness. If not, is there a better way with navigation, maybe like their backend?

1 Answer 1

2

Assets 2.1 is out and for me it works like this:

<ul>
    {exp:assets:folders parent_folder="{filedir_}"}
        <li>{folder_name}</a>
            {if total_subfolders}
                <ul>
                    {subfolders}
                </ul>
            {/if}
            <ul>
                {exp:assets:files folder_id="{folder_id}"}
                        <li><a href="{url}">{if title != ""}{title}{if:else}{filename}{/if} ({size})</a></li>
                {/exp:assets:files}
            </ul>
        </li>
    {/exp:assets:folders}
</ul>
1
  • Yes, I was all over the 2.1 update. Thanks!
    – Blair
    Apr 15, 2013 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.