|
|
“Radio Macro: listFolder” |
|||
| From: | Seth Dillingham | In Response To: | Top of Thread. |
| Date Posted: | Tuesday, February 26, 2002 12:13:46 AM | Replies: | 4 |
| Enclosures: | listFolder.ftsc.sit (4K), listFolder.ftsc.zip (4K) | ||
Clark Venable asked me to write a Radio macro for him which would list the contents of a folder. Files should have a file icon, folder a folder icon, and the text for each item would the title of the page, in a link.
It took a couple hours to make it work correctly, mainly because some parts of Radio are a little confusing, and then there were the special cases that had to be trapped.
For an output sample, browse my Radio test site.
Clark wants to share it with the community, so for now you can download it from here (.sit or .zip). After downloading it, decompress it and open the file in Radio. There are instructions at the top of the script for installing it. I'll post full instructions tomorrow (I need some sleep!).
The short version: Either pass parameters for the folder and file icons, or make sure you define two directives in your page or your #prefs.txt file. The directives are: #listFolder_defaultFolderIcon, and #listFolder_defaultFileIcon. The values of these parameters/directives are the short paths to image files, like what you would pass to the Radio.macros.imageRef macro. Examples:
#listFolder_defaultFolderIcon "system/images/apacheIcons/folder2.gif"
#listFolder_defaultFileIcon "system/images/apacheIcons/file2.gif"
If and when Clark is ready, I'll either point to it on his site or at least add a link for downloading it there.
Incidentally, the output from this macro is an awful lot like another macro for doing something very similar. Of course, then there's siteliner, which also did something similar, but I'm afraid to look at that old code. :::shudder:::
I hate to say this... but some parts of Radio are like that, too: the spagetti code makes me shudder. Trying to debug upstreaming problems in Radio is a nightmare. Most of Radio is very well done, but they should have used the queue suite, or something like it, for upstreaming. It helps prevent race conditions, and I think that's where the upstreaming problems are coming from. If nothing else, it would have simplifed some of the code.
There are no trackbacks.
|
TruerWords
is Seth Dillingham's personal web site. Read'em and weep, baby. |