We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42511
    • 60 Posts
    Hi,
    I'm sure this must be covered somewhere but search as I might I can't find the answer.
    I'm trying to create a list of filenames from a folder (assets/templates/pics).
    I want it to look like:
    <ul class="myclass">
    <li>filename</li>
    <li>filename1</li>
    </ul>

    I was trying to use FiledownloadR as it looked as though it sort of did what I wanted but all I get is a list of error messages as it seems to be looking in 'core/components/filedownloadr/chunks' for the chunk that I put into the chunks folder, it also seems to default to dislaying a header row for a file listing - which I don't really want.
    I'm calling it from a chunk with another chunk as a template for each line:
    <ul class="picslist">
    [[!FileDownload?
    &getDir=`assets/templates/pics`
    &tplFile=`[[$picslistTpl]]`]]
    </ul>


    picslistTpl:
    <li><img src="[[+fd.filename]]" /></li>


    Is there a more straightfdorward way of doing this?
    Tried searching the forums but I can't make the search specific enough to return anything useful.
    I'm using Revolution v2.2.8 currently working on a local install using xampp.
    Thanks
    Allan

    This question has been answered by sottwell. See the first response.

    • discuss.answer
      • 28042 ☆ A M B ☆
      • 24,524 Posts
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 42511
        • 60 Posts
        Thanks,
        Used:
        <ul class="picslist">
        [[!FileLister? &path=`assets/templates/pics/` &showDirectories=`0`&fileTpl=`picslistTpl`]]
        </ul>

        and
        <li>[[+path]]</li> 


        Does just as I wanted.
        regards
        Allan [ed. note: allan1 last edited this post 13 years, 2 months ago.]