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

Luke Tymowski ltymowski@attglobal.net
Mon, 03 Jul 2000 10:03:35 -0400


Hello,

I'm still having trouble trying to get Zope to use/ignore header and footer 
code in the appropriate places.

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)">

My problem was that on the first sequence item returned, Zope would insert 
the footer code. On items 2 and 3, Zope would not display the footer code, 
and, again, at the end of the page, when I did want the footer code to 
appear, it wouldn't.

I had no trouble with the header code.
I assume it had no trouble with the header code because by calling it to 
display that document itself, Zope inserted the code and set the 
renderedheader to 1, causing it to be ignored elsewhere in the document, as 
it should.

So. Is there a better way to do this? Or is the above meet and right and 
not worthy of shame? I want to write a How-To so other newbies don't have 
to go through what I did.

thank you,

Luke