Re: [Zope] Rendering files with exception
| OdesÃlatel: Dieter Maurer <dieter@handshake.de> | | Jaroslav Lukesh writes: | > ... | > <dtml-with expr="objectValues('DTML Document')"> | This looks wrong: | | "objectValues" returns a list, "dtml-with" expects an object | with (interesting) attributes. Many thanks. I was try to do with WITH tag, but not successfully. So I was try TRY tag <dtml-try> <dtml-var index.htm> <dtml-except> <dtml-var standard_html_header> <dtml-var sys_list-item> <dtml-var standard_html_footer> </dtml-try> but it does render parent index.htm instead folder content due acquisition. So it is some way to tell that I do not want acquisition? I was play with PARENTS[0], but I dont know exact syntax. Either that codes still does not have TRUE to render index.htm. <dtml-if "hasId('index.htm')"> <dtml-var index.htm> <dtml-else>... <dtml-if expr="_.string.find(_['index.htm'],'index.htm')==0"> <dtml-var index.htm> <dtml-else>... Thanks J. Lukesh
Jaroslav Lukesh writes:
I was try to do with WITH tag, but not successfully. So I was try TRY tag
<dtml-try> <dtml-var index.htm> <dtml-except> <dtml-var standard_html_header> <dtml-var sys_list-item> <dtml-var standard_html_footer> </dtml-try> It seems that you would like to render "index.htm" if it exists in the current folder and do something else, otherwise.
The following code is not completely safe but may be sufficient for your purposes: <dtml-if "_.hasattr(aq_explicit,'index.htm')"> <dtml-var index.htm> <dtml-else>.... </dtml-if> If you want to learn more about "aq_explicit", read <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html> Dieter
participants (2)
-
Dieter Maurer -
Jaroslav Lukesh