[Zope] DTML syntax
Kevin Dangoor
kid@kendermedia.com
Thu, 26 Aug 1999 10:14:46 -0400
-----Original Message-----
From: Tim Wilson <wilson@chemsun.chem.umn.edu>
To: Zope Listserv <zope@zope.org>
Date: Thursday, August 26, 1999 1:59 AM
Subject: Re: [Zope] DTML syntax
>On Wed, 25 Aug 1999, Kevin Dangoor wrote:
>
>> If it works better for you, you can store the PDFs in the same area as
other
>> related content. If you want to make a central PDF download page, you
could
>> then set up ZCatalog to index the property "content_type", and do a Find
to
>> catalog the objects. Then, your download page just needs to search the
>> catalog for content_type: application/pdf (or whatever the type is).
>>
>> It could be as simple as:
>>
>> <dtml-in "Catalog({'metatype': 'File', 'content_type':
'application/pdf'})">
>> <a href="/<dtml-var "getpath(data_record_id_)">/index.html"><dtml-var
>> title></a>
>> </dtml-in>
>
>OK, this is cool. I just read the ZCatalog tutorial. Are you suggesting a
>simple search interface at the central download page or simply using
>ZCatalog to find the relevant, but scattered, PDF files and then create
>some sort of list of them that a user can click on?
You can really do it either way. You can present it to the user as a search
interface, which might be nice if you have a whole bunch of docs. Or, if you
want to present it more as a download directory (a static-looking list, as
opposed to a search), you can just use that code above. The code above does
dynamically generate the file list, but the user won't be able to tell if it
is static or dynamic.
The great thing about ZCatalog is that you can arrange your objects in the
ZODB in ways that are convenient to you and still be able to present the
users with different views that are independent of an object's location. As
Michel mentioned, this is exactly how the new Zope.org beta site works. I
can put a news item or howto in my Members page, and then it will show up in
the central location for those items through the Catalog.
Kevin