Is it possible to make an alphabetical list like the Gallery List on the Softpress site?
This is done (in the Softpress site) by means of a MySQL database and PHP scripting. You can make a somewhat similar structure out of existing static pages in Freeway using the Site Map Action.
Can you say a little more about what you need your list to do?
I’m trying to create a list of articles for my website. The existing page can be seen here:
It gets very labor intensive every time I add a new article to one of the boxes, so I’m trying to find an easier way to add titles that still looks pretty good.
Any suggestions or examples? I don’t really want to hassle with MySQL databases or PHP scripting since that’s beyond my capabilities.
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.
Walter
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:
It gets very labor intensive every time I add a new article to one
of the boxes, so I’m trying to find an easier way to add titles
that still looks pretty good.
Any suggestions or examples? I don’t really want to hassle with
MySQL databases or PHP scripting since that’s beyond my capabilities.
Walt, as always, I appreciate your help. And if re-purposing one of your directory-listing scripts would work, that would be great.
I’ll gladly donate $50 to your online beer fund for the effort. That won’t come close to covering your expenses, but it’ll buy a few cases of good beer.
Do you have PHP5 on your server, or are you stuck on 4, or do you
have the choice? PHP5 makes gathering the raw data for a directory
listing into a lovely one-line affair:
$list_array = scandir('path/to/directory');
PHP 4 makes it a pain in the neck, virtually speaking.
Walter
On Jun 2, 2008, at 11:56 AM, Jamie Turner wrote:
Walt, as always, I appreciate your help. And if re-purposing one of
your directory-listing scripts would work, that would be great.
I’ll gladly donate $50 to your online beer fund for the effort.
That won’t come close to covering your expenses, but it’ll buy a
few cases of good beer.
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.
I’m going to give this a shot and see where it takes me. It looks as though this could be a good solution. Thanks for all your help.
I’m on vacation later this week, so it might be next week before I circle around with another question or two. In any case, I appreciate all your help.
This function will stand in for scandir on servers that don’t have the native function. If anything else breaks under 4 (can’t test it here any more), let me know and I’ll figure out a work-around.