Re: [Zope] problem in using Zcatalog : Help needed
Hi All, I have this problem in using ZCatalog. I have the Zcatalog and the folders that contained the DTML Documents in the root. |-root |--Zcat_Index_1_Dtml_Doc |--news(folder) |---article1(folder) |----x1(DTML Doc) |----xn(DTML Doc) |---article2(folder) |----x1(DTML Doc) |----xn(DTML Doc) |--news1(folder) |---article1(folder) |----x1(DTML Doc) |----xn(DTML Doc) |---article2(folder) |----x1(DTML Doc) |----xn(DTML Doc) What surprise me was that it shows the absolute url when I did not include _.getitem(mm,1) but display Nothing when included. <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> Also I will like to know how to use pathindex just the way i used 'id' to enable me limit the result to those DTML Documents that have the same id and pathindex. I will appreciate any idea that help to solve this problem. Thanks. ===== Hamzat kamaldeen Ishola Dnet Systems Limited. 223 Ikorodu Road, Lagos. Nigeria. 234 1 7749381, 234 08033011305 --- Making Mistake is not a problem but readiness to admit it. Sentimental decisions are not mistakes but failures !!! Mistake is an opportunity to see better !!! __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
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
Hi Max, Thanks for your response then this is a the error encountered with Zope Error Zope has encountered an error while publishing this resource. Error Type: KeyError Error Value: 050802
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>
===== Hamzat kamaldeen Ishola Dnet Systems Limited. 223 Ikorodu Road, Lagos. Nigeria. 234 1 7749381, 234 08033011305 --- Making Mistake is not a problem but readiness to admit it. Sentimental decisions are not mistakes but failures !!! Mistake is an opportunity to see better !!! __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
Hamzat Kamal wrote:
Hi Max, Thanks for your response then this is a the error encountered with
Zope Error Zope has encountered an error while publishing this resource.
Error Type: KeyError Error Value: 050802
<dtml-var expr="_.getitem(mm,1)[0:400]"> Are you shure that mm has an item 1 ??? 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
participants (2)
-
Hamzat Kamal -
Max M