[Zope] problem in using Zcatalog : Help needed
Max M
maxm@mxm.dk
Mon, 05 Aug 2002 16:50:53 +0200
Hamzat Kamal wrote:
> Hi All,
>
> I have this problem in using ZCatalog.
>
> I have the Zcatalog and the folders that contained the DTML
> Documents in the root.
>
Ok I think I understand what you are trying to do here::
<dtml-call "REQUEST.set('mm',
ZopeTime().toZone('GMT+1').strftime('%d%m%y'))">
<ul>
<dtml-in "Zcat_Index_1_Dtml_Doc(id=mm)">
<dtml-var expr="_.getitem(mm,1)[0:400]">... <br>
<li>
<a href="&dtml-absolute_url;"> More </a>
</li>
</dtml-in>
</ul>
I think your code could be expressed a little better like::
<dtml-call "REQUEST.set('now',
ZopeTime().toZone('GMT+1').strftime('%d%m%y'))">
<ul>
<dtml-in "Zcat_Index_1_Dtml_Doc(id=now)">
<dtml-var "_.getitem(now,1)" size=400>... <br>
<li>
<a href="&dtml-absolute_url;"> More </a>
</li>
</dtml-in>
</ul>
If you want to want to be able to show the absolute_url from the
cataloged object you need to create a "Metadata" called 'absolute_url'
in the catalog. Then it will be saved together with the rest of the
objects metadata.
you can probably use the pathindex like this::
pathindex='path/to/some/*/document'
with a wildcard character.
But I will warn you that it is a pretty dirty way you are using zope.
There are quite a lot of problems in your approach with document
components saved as seperate Dtml-Documents.
In the long run I think you will be more satisfied with a solution based
on html or structured text in a single dtml-method.
Or create a single Python Product or zClass that has some of the
following attributes::
class article:
id
title
summary
content # only 1 field for content
author
regards
Max M
--
"Sorry I would Really Like To Help More On This Project,
But Am To Busy Doing Paid Work On A Tight Deadline"
Max M