[Zope] Is there a better way to code this?

Dieter Maurer dieter@handshake.de
Mon, 3 Jul 2000 23:51:11 +0200 (CEST)


Luke Tymowski writes:
 > To have Zope ignore the footer code in one place but still display footer 
 > code on other pages, I've resorted to this:
 > <dtml-with history>
 >    <dtml-with 2000>
 >      <dtml-in "objectValues(['DTML Document'])" size=3 sort=title reverse>
 >        <dtml-call "REQUEST.set('renderedfooter',1)">
 >        <dtml-var sequence-item>
 >        <a href="/history/2000/<dtml-var id>" title="Permanent link to the 
 > entry for <dtml-var title>">PermaLink</a>
 >        <br>&nbsp;<br>
 >      </dtml-in>
 >    </dtml-with>
 > </dtml-with>
 > <dtml-call "REQUEST.set('renderedfooter',0)">
What about

<dtml-with "_.namespace(standard_html_header='',
                        standard_html_footer='')">
   ... your code without "REQUEST" mangling ...
</dtml-with>


This redefines "standard_html_header/footer" inside the "with".
Should work for DTML methods/documents.


Dieter