It might actually end up being easier to script it on the server
side, particularly as you site grows. I had a look at the Site Map
action, but it won’t do what I thought it would – limit itself to a
single folder – so it probably wouldn’t work for you.
I’ll see if I can repurpose one of my directory-listing scripts here
and make it easy to style using Freeway.
On Jun 2, 2008, at 9:42 AM, Jamie Turner wrote:
Hi, Walt –
Thanks for your help.
I’m trying to create a list of articles for my website. The
existing page can be seen here:
Save this script as ‘file_list.php’ (using a REAL text editor like the free TextWeaver or the expensive BBEdit or the moderately-priced TextMate) and put it into the folder on your server that you want to display as a list. To call it forth in Freeway, do the following (working from a page that is “outside” the folder you are listing):
Change your page filename to end in .php.
Draw a markup item on the page where you want the list to appear, and inside it put the code: <?php include('foldername/file_list.php'); ?> (be sure to change foldername to match the folder that you are listing)
Upload the new page to your server and view it there (this will not work in a local preview mode).
What should happen is you should see an unordered list of links to all files in your folder.
To style this list, create a new class style called dirlist and add your styles to it. Also, if you create a class style called ‘even’ and another called ‘odd’, you can have alternating background stripes or whatever to help people scan the list visually.
For more layout control, draw an HTML box to contain the list, and use my Crowbar Action to get the PHP include statement into it without generating a surrounding (and invalid) P tag.
It just occurred to me that this folder list is not going to be in latest first order or anything fancy like that. It will be alphabetical filename order, from A-Z and then a-z (not a typo – Unix considers capital letters to come before lower-case letters).
It could be extended to do more fancy stuff, like sort by file modification date or whatnot, but you should try this out and see if it works for you before we go all crazy on it.