Hi, I have wanted to use getitem() in a Dtml Method to render docs "now" which are located in the subfolders where the Dtml Method is . <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=100>... <br> <li> <a href="&dtml-absolute_url;"> More </a> </li> </dtml-in> </ul> How do I refference these subfoders so that those Docs can be rendered by the getitem(). 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 writes:
I have wanted to use getitem() in a Dtml Method to render docs "now" which are located in the subfolders where the Dtml Method is .
<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=100>... <br> <li> <a href="&dtml-absolute_url;"> More </a> </li> </dtml-in> </ul>
How do I refference these subfoders so that those Docs can be rendered by the getitem(). What happens? What goes wrong?
Dieter
--- Dieter Maurer <dieter@handshake.de> wrote:
Hamzat Kamal writes:
I have wanted to use getitem() in a Dtml Method to render docs "now" which are located in the subfolders where the Dtml Method is .
<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=100>... <br> <li> <a href="&dtml-absolute_url;"> More </a> </li> </dtml-in> </ul>
How do I refference these subfoders so that those Docs can be rendered by the getitem().
What happens? What goes wrong?
Thanks Dieter, What I noticed was that without this statement ; <dtml-var "_.getitem(now,1)" size=100>... <br> the absolute_url displayed but when I included the statement this was the error i got ; Error Type: KeyError Error Value: 070802 Meaning that the getitem can not get the doc "now" which is 070802. Pls, how do I make getitem to render this doc "now". Thanks in anticipation. ===== Hamzat kamaldeen Ishola Dnet Systems Limited. 223 Ikorodu Road, Lagos. Nigeria. 234 1 7749381, 234 08033011305 --- If Mistake is an opportunity to see better, then it is not a problem but readiness to admit it. Sentimental decisions are not mistakes but failures !!! __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
Sir K writes:
... What I noticed was that without this statement ; <dtml-var "_.getitem(now,1)" size=100>... <br> the absolute_url displayed but when I included the statement this was the error i got ;
Error Type: KeyError Error Value: 070802 This means that there in no object bound to '070802' reachable via the DTML namespace.
Note, that ZCatalog searches do not return the real object but only some meta data remembered when the object is catalogued. This may be one reason why the "now" lookup fails. Are you sure, the "absolute_url" gives you the correct URL? I would be surprised if "ZCat_Index_1_Dtml_Doc" is indeed a catalog search (as I assume because of its name). Dieter
participants (3)
-
Dieter Maurer -
Hamzat Kamal -
Sir K