Code example list files in folder

Listing files in current folder

Code for listing files in current folder

<table class="table table-striped" style="width:auto">
    <thead>
        <tr>
            <th>Filnavn</th>
            <th>Dato</th>
            <th>Last ned</th>
        </tr>
    </thead>
    <tbody data-loop="sortdesc(getpages(request.folderpath),'Title')" data="#">
        <tr>
            <td>
                #this.Title#
            </td>
            <td>
                #this.Modified#
            </td>
            <td>
                <a href="#request.filepath#/#this.filename#">Last ned</a>
            </td>
        </tr>
    </tbody>
</table>

Listing files from a specific folder

<table class="table table-striped" style="width:auto">
    <thead>
        <tr>
            <th>Filnavn</th>
            <th>Dato</th>
            <th>Last ned</th>
        </tr>
    </thead>
    <tbody data-loop="sortdesc(getpages('folderpath/subfolder'),'PublishDate')" data="#">
        <tr>
            <td>
                #this.Title#
            </td>
            <td>
                #this.Modified#
            </td>
            <td>
                <a href="#request.filepath#/#this.filename#">Last ned</a>
            </td>
        </tr>
    </tbody>
</table>