[Zope] Re: How to avoid the inheritance of DTMLDocuments?
Philipp Robbel
philipp.robbel@eml.villa-bosch.de
Tue, 24 Jul 2001 09:29:53 +0100
Hi jcc,
first of all: thanks for your help but I ran into a small problem with your
code:
> <dtml-with aq_explicit only>
> <dtml-var index.html>
> </dtml-with>
If the index.html references to Objects other the aq_explicit namespace, the
code fails (right?)
I modified the code to this:
<dtml-with aq_explicit only>
<dtml-if expr="_.hasattr(this(),'index_html')"><dtml-with REQUEST><dtml-call
"REQUEST.set('temp','1')"></dtml-with>
<dtml-elif expr="_.hasattr(this(),'index_htm')"><dtml-with
REQUEST><dtml-call "REQUEST.set('temp','2')"></dtml-with>
<dtml-else><dtml-with REQUEST><dtml-call
"REQUEST.set('temp','3')"></dtml-with>
</dtml-if>
</dtml-with>
<dtml-if "temp=='1'"><dtml-var index.html>
<dtml-elif "temp=='2'"><dtml-var index.htm>
<dtml-else><dtml-var header>The <dtml-var "title_or_id()"> site is not yet
available.<dtml-var footer>
</dtml-if>
This seems to work properly...
Can you think of any pitfalls or a more elegant solution?
Thanks again for your help,
Philipp