[albatross-users] <al-for> help!
John Abel
admin at ccj-online.co.uk
Fri Oct 28 04:21:59 EST 2005
No problem, here's the cgi, and the templates. The code is fairly
explanatory. I have a function, which takes a directory listing, and
looks in the sub-directories for index.html files. If an index page
is found, it then returns the contents of <title>, along with the
path of the index file.
My directory structure looks like:
Sites
- cgi-bin
- - libLibrary
- BooksOnline
- - albatross
- - MySQL
- - Python-Docs-2.4.2
I appreciate all the help, guys!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: library.cgi
Type: application/octet-stream
Size: 2179 bytes
Desc: not available
URL: <http://www.object-craft.com.au/pipermail/albatross-users/attachments/20051027/02ab50ec/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.object-craft.com.au/pipermail/albatross-users/attachments/20051027/02ab50ec/attachment.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.object-craft.com.au/pipermail/albatross-users/attachments/20051027/02ab50ec/attachment-0001.html>
-------------- next part --------------
On 27 Oct 2005, at 18:55, Frederick Polgardy wrote:
> Do you modify locals.bookLinks or locals.foundBooks anywhere else
> in your code? It's really hard to tell what's going on from what
> we're seeing here. Can you post a small but complete demo that
> illustrates the problem?
>
> John Abel wrote:
>
>
>> Hi!
>>
>> I'm hoping someone can point me in the right direction. I have a
>> dictionary containing paths, and a description for each. I have
>> assigned each to locals like so:
>>
>> simpleCtx.locals.foundBooks = foundBooks
>> simpleCtx.locals.bookLinks = foundBooks.keys()
>>
>> I've then iterated on the list with this:
>>
>> <al-for iter="book" expr="bookLinks">
>> <tr>
>> <td style="width: 15%;">Picture Will Go There</
>> td>
>> <td><a href='<al-value expr="book.value
>> ()">'><al- value expr="foundBooks[ book.value() ]"></a></td>
>> </tr>
>> </al-for>
>>
>> The odd thing, is the list loops twice, and then exits. If I run
>> the cgi from the command line, it processes the entire list, and
>> displays them all ( as per below ).
>>
>> I'm running on OSX 10.4.2, using Apple's Apache. I've tried
>> Python2.3 and Python2.4.2, with the same results.
>>
>> Any pointers would be much appreciated.
>>
>> Regards
>>
>> J
>>
>> Content-Type: text/html
>>
>> <html>
>> <head>
>> <title>Library - Main Page</title>
>> </head>
>> <body>
>> <h1>Main Page</h1>
>> <hr noshade>
>> <table style="text-align: left; width: 45%; " border="1"
>> cellpadding="0" cellspacing="0">
>> <tbody>
>> <tr>
>> <td style="width: 15%;">Picture Will Go There</
>> td>
>> <td><a href='BooksOnline/MySQL/index.html'>
>> MySQL 4.1 Reference Manual</a>
>> </td>
>> </tr>
>> <tr>
>> <td style="width: 15%;">Picture Will Go There</
>> td>
>> <td><a href='BooksOnline/albatross/index.html'>
>> Albatross Manual</a>
>> </td>
>> </tr>
>> <tr>
>> <td style="width: 15%;">Picture Will Go There</
>> td>
>> <td><a href='BooksOnline/networking/index.htm'>
>> The Networking CD Bookshelf</a>
>> </td>
>> </tr>
>> <tr>
>> <td style="width: 15%;">Picture Will Go There</
>> td>
>> <td><a href='BooksOnline/networking/index.html'>
>> The Networking CD Bookshelf</a>
>> </td>
>> </tr>
>> <tr>
>> <td style="width: 15%;">Picture Will Go There</
>> td>
>> <td><a href='BooksOnline/perl4/index.htm'>
>> The Perl CD Bookshelf, v4.0</a>
>> </td>
>> </tr>
>> <tr>
>> <td style="width: 15%;">Picture Will Go There</
>> td>
>> <td><a href='BooksOnline/unix3/index.htm'>
>> The Unix CD Bookshelf, v3.0</a>
>> </td>
>> </tr>
>> <tr>
>> <td style="width: 15%;">Picture Will Go There</
>> td>
>> <td><a href='BooksOnline/unix3/index.html'>
>> The Unix CD Bookshelf, v3.0</a>
>> </td>
>> </tr>
>> </tbody>
>> </table>
>> </body>
>> </html>
>>
>> _______________________________________________
>> Albatross-users mailing list
>> Albatross-users at object-craft.com.au
>> https://www.object-craft.com.au/cgi-bin/mailman/listinfo/albatross-
>> users
>>
>>
>
>
More information about the Albatross-users
mailing list