[Zope] inserting half a dtml tag into a zclass

Dieter Maurer dieter@handshake.de
Fri, 29 Dec 2000 10:38:10 +0100 (CET)


Tim Hicks writes:
 > This is a multi-part message in MIME format.
 > 
 > ------=_NextPart_000_0009_01C07071.533E96C0
 > Content-Type: text/plain;
 > 	charset="iso-8859-1"
 > Content-Transfer-Encoding: quoted-printable
You are here long enough: you should know, we do not like MIME
messages.

 > ... isolating privacy checks ...
 > <dtml-var privacy>
 > <dtml-var standard_html_header>
 > <dtml-var standard_html_footer>
 > </dtml-if>

I know about 2 possible approaches:

 I. let your "privacy" method return a value (using "dtml-return")
    and check it above:

    <dtml-if privacy>
      ...header...
      ...
      ...footer...
    </dtml-if>

 II. I think (this implies, I am not sure), that ZPublisher
     translates exceptions into HTTP response codes.
     This would mean, you could try:

       In your "privacy" method:
	  ....
	  <dtml-call "RESPONSE.redirect(...)">
	  <dtml-raise type="Redirect"></dtml-raise>
	  ....

       in your other objects:

          <dtml-call privacy>
	  ...header...
	  ....
	  ...footer...


Dieter