Chapter 8. Custom Directory Listings

Table of Contents
Defining a template

Directory listings are fully customizable in Abyss Web Server. If you do not like their standard look, you can provide the server with your listing template. Advanced users can do better by writing a script to generate custom listings.

Defining a template

A directory listing template is defined by its:

When generating a directory listing using a template, the server creates a special XSSI environment before processing the header, the line description for every file in the listing, and the footer. So you can (in fact, you should) use XSSI directives to insert information about every file in the generated page.

While processing the line description for a given file, the server sets the following environment variables in addition to the standard CGI environment variables:

Example 8-1. A simple directory listing template

  • MIME Type:

       text/html; charset=utf-8

  • Header:

             Index of <!-- #echo var="URL" encoding="reverse-url" -->
           <TABLE BORDER=0>
               <TD>MIME Type</TD>

  • Body Line:

                 <A HREF="<!-- #echo var="DIRLIST_FILE_URL" -->">
                   <!-- #echo var="DIRLIST_FILE_NAME" -->
               <TD> <!-- #echo var="DIRLIST_FILE_SIZE" --> </TD>
               <TD> <!-- #echo var="DIRLIST_FILE_DATE" --> </TD>
               <TD> <!-- #echo var="DIRLIST_FILE_MIME_TYPE" --> </TD>

  • Footer: