[Zope] avoiding dtml recursion

Warnes, Gregory R gregory_r_warnes@groton.pfizer.com
Thu, 16 May 2002 18:00:30 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1FD25.18386190
Content-Type: text/plain;
	charset="iso-8859-1"

OK, I've found one solution.  Its not pretty, but it works:
 
    <!-- Make sure we only get this notice once --!>
    <dtml-unless "REQUEST.get('voodoo',None)==1"> 
    
      <p>
      <center><FONT SIZE=+1 COLOR=#FF0000>PRE-RELEASE
VERSION</FONT></center>
      </p>
    
      <dtml-call "REQUEST.set('voodoo',1)">
    </dtml-unless>
 
    <dtml-with aq_parent only>
      <dtml-var standard_html_footer>
    </dtml-with>
 
 
Does anyone else have a better solution? 
 
-Greg
 

-----Original Message-----
From: Warnes, Gregory R [mailto:gregory_r_warnes@groton.pfizer.com]
Sent: Thursday, May 16, 2002 4:34 PM
To: zope@zope.org
Subject: [Zope] avoiding dtml recursion


Hi all
 

I want to have a dtml file <standard_html_footer> that includes the contents
of a <standard_html_footer> defined higher in the hierarchy.
 
I tried
 
    <p>
    <center><FONT SIZE=+1 COLOR=#FF0000>PRE-RELEASE VERSION</FONT></center>
    </p>
    
    <dtml-with aq_parent only>
      <p><dtml-var standard_html_footer></p>
    </dtml-with>
    
    </body>
    </html>
 
This works in the directory where this dtml-method is, however, I get
another 'PRE-RELEASE VERSION' tacked on for every level down I go.  
 
What is the proper way to get around this?
 
Thanks
 
-Greg


LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be
privileged. It is intended for the addressee(s) only. Access to this E-mail
by anyone else is unauthorized. If you are not an addressee, any disclosure
or copying of the contents of this E-mail or any action taken (or not taken)
in reliance on it is unauthorized and may be unlawful. If you are not an
addressee, please inform the sender immediately.



------_=_NextPart_001_01C1FD25.18386190
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 5.50.4616.200" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=546575021-16052002>OK, 
I've found one solution.&nbsp; Its not pretty, but it works:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=546575021-16052002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier color=#0000ff size=2><SPAN 
class=546575021-16052002>&nbsp;&nbsp;&nbsp; <FONT face=Arial>&lt;!-- Make sure 
we only get this notice once --!&gt;</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Courier color=#0000ff size=2><SPAN 
class=546575021-16052002>&nbsp;&nbsp;&nbsp; &lt;dtml-unless 
"REQUEST.get('voodoo',None)==1"&gt; </SPAN></FONT></DIV>
<DIV><FONT face=Courier color=#0000ff size=2><SPAN 
class=546575021-16052002>&nbsp;&nbsp;&nbsp; </SPAN></FONT></DIV>
<DIV><FONT face=Courier color=#0000ff size=2><SPAN 
class=546575021-16052002>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;p&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;center&gt;&lt;FONT SIZE=+1 
COLOR=#FF0000&gt;PRE-RELEASE 
VERSION&lt;/FONT&gt;&lt;/center&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/p&gt;</SPAN></FONT></DIV>
<DIV><FONT face=Courier color=#0000ff size=2><SPAN 
class=546575021-16052002>&nbsp;&nbsp;&nbsp; </SPAN></FONT></DIV>
<DIV><FONT face=Courier color=#0000ff size=2><SPAN 
class=546575021-16052002>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-call 
"REQUEST.set('voodoo',1)"&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;/dtml-unless&gt;</SPAN></FONT></DIV>
<DIV><FONT face=Courier color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier color=#0000ff size=2><SPAN 
class=546575021-16052002>&nbsp;&nbsp;&nbsp; &lt;dtml-with aq_parent 
only&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-var 
standard_html_footer&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;/dtml-with&gt;</SPAN></FONT></DIV>
<DIV><FONT face=Courier color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=546575021-16052002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=546575021-16052002>Does 
anyone else have a better&nbsp;solution?&nbsp;</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=546575021-16052002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=546575021-16052002>-Greg</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Warnes, Gregory R 
  [mailto:gregory_r_warnes@groton.pfizer.com]<BR><B>Sent:</B> Thursday, May 16, 
  2002 4:34 PM<BR><B>To:</B> zope@zope.org<BR><B>Subject:</B> [Zope] avoiding 
  dtml recursion<BR><BR></FONT></DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff size=2>Hi 
  all</FONT></SPAN></DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=923170720-16052002>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff size=2>I 
  want to have a dtml file &lt;standard_html_footer&gt; that includes the 
  contents of a &lt;standard_html_footer&gt; defined higher in the 
  hierarchy.</FONT></SPAN></DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff size=2>I 
  tried</FONT></SPAN></DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff 
  size=2>&nbsp;&nbsp;&nbsp; &lt;p&gt;<BR>&nbsp;&nbsp;&nbsp; 
  &lt;center&gt;&lt;FONT SIZE=+1 COLOR=#FF0000&gt;PRE-RELEASE 
  VERSION&lt;/FONT&gt;&lt;/center&gt;<BR>&nbsp;&nbsp;&nbsp; 
  &lt;/p&gt;</FONT></SPAN></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=923170720-16052002>&nbsp;&nbsp;&nbsp; </SPAN></FONT></DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff 
  size=2>&nbsp;&nbsp;&nbsp; &lt;dtml-with aq_parent 
  only&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p&gt;&lt;dtml-var 
  standard_html_footer&gt;&lt;/p&gt;<BR>&nbsp;&nbsp;&nbsp; 
  &lt;/dtml-with&gt;</FONT></SPAN></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=923170720-16052002>&nbsp;&nbsp;&nbsp; </SPAN></FONT></DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff 
  size=2>&nbsp;&nbsp;&nbsp; &lt;/body&gt;<BR>&nbsp;&nbsp;&nbsp; 
  &lt;/html&gt;</FONT></SPAN></DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff size=2>This 
  works in the directory where this dtml-method is, however, I get another 
  'PRE-RELEASE VERSION' tacked on for every level down I go.&nbsp; 
  </FONT></SPAN></DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=923170720-16052002><FONT face=Arial color=#0000ff size=2>What 
  is the proper way to get around this</FONT></SPAN><FONT face=Arial><FONT 
  color=#0000ff><FONT size=2><SPAN 
  class=923170720-16052002>?</SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
  class=923170720-16052002></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
  class=923170720-16052002>Thanks</SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
  class=923170720-16052002></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
  class=923170720-16052002>-Greg</SPAN></FONT></FONT></FONT></SPAN></DIV></DIV><CODE><FONT 
  size=3><BR><BR>LEGAL NOTICE<BR>Unless expressly stated otherwise, this message 
  is confidential and may be privileged. It is intended for the addressee(s) 
  only. Access to this E-mail by anyone else is unauthorized. If you are not an 
  addressee, any disclosure or copying of the contents of this E-mail or any 
  action taken (or not taken) in reliance on it is unauthorized and may be 
  unlawful. If you are not an addressee, please inform the sender 
  immediately.<BR></BLOCKQUOTE></FONT></CODE></BODY></HTML>

------_=_NextPart_001_01C1FD25.18386190--