[Zope] Scoping of <dtml-let>
Jean-Francois.Doyon@CCRS.NRCan.gc.ca
Jean-Francois.Doyon@CCRS.NRCan.gc.ca
Wed, 8 Jan 2003 15:48:46 -0500
Hello,
In my hunt for my memory leak, I have discivered I probably shouldn't =
use
REQUEST.set nearly as much as I do.
So now, I have a few questions/problems regarding <dtml-let> ...
First of all, is there any way to have it scope over more than one =
object?
For instance, how would I set a variable in standard_html_header that =
would
be valid for the entire output (i.e. that could be used by other DTML =
code
that is rendered after standard_html_header, as part of a given page of
output?) For instance I used to do REQUEST.set(sniffer, usersniffer()) =
...
The sniffer dictionary was then available everywhere thereafter, =
including
DTML code in the object containing the header. Unfortunately, using
<dtml-let>, I can't do this, since I can't even save a dTML document =
where a
<dtml-let> opens but isn't closed (I would close it, say, in the =
footer). Is
there any proper DTML way of doing something liek this without using
REQUEST.set ???
Also, basically on the same topic, how do I nest <dtml-let> with =
<dtml-if> ?
One of the reasons I resorted to using REQUEST.set is because I often =
would
want to do things like:
<dtml-if "">
<dtml-let>
<dtml-else>
<dtml-let>
</dtml-if>
</dtml-let>
Which doesn't work, and I bviously don't want to repeat entire blocks =
of
code for both conditions, and in most cases breaking them out into =
seperate
objects doesn't make sense either ...
Any insight into how to get around these issues would be much =
appreciated!
Thanks in advance,
Jean-Fran=E7ois Doyon
Internet Service Development and Systems Support / Soutien de =
syst=E8mes et
developement de services Internet
GeoAccess Division / Division G=E9oAcc=E8s
Canada Center for Remote Sensing / Centre canadien de =
t=E9l=E9d=E9tection
Natural Resources Canada / Ressources naturelles Canada
Phone / T=E9l=E9phone: (613) 992-4902
Fax / T=E9l=E9copieur: (613) 947-2410
http://atlas.gc.ca