[Zope] Re: acquisition from parent within standard_html_header

Service Informatique CHSR chsrinfo@guetali.fr
Mon, 1 Mar 1999 14:38:49 +0400


Hello,

Sorry for the waste of bandwith. I found the problem.
But the story is interresting enough to be shared.
See at the end of the message.

>I want to *add* content to the default standard_html_header in a subfolder
>that we call, say, SF. The standard_html_header in SF reads:
>
><!--#var standard_html_header-->
><!-- other content-->
>
>But since an object acquire from itself, this did not work (infinite
>traceback,
>obviously because the stack is filled with recursive calls)
>So I wrote:
>
><!--#with aq_parent--><!--#var standard_html_header--><!--#/with>
><!-- other content-->
>
>And it works for object accessed within SF. But when I create sub-folder
>*under*
>SF, say SSF, I end up with an error.
>
>How could i write this?


Well, I found that standard_html_header were called several times, and
that's what caused the error.
Let SF/standard_html_header be:

--------8<--------
<!--#with aq_parent--><!--#var standard_html_header--><!--#/with-->
Hello!
--------8<--------

Then, when I access http://mysite/SF, I get:

--------8<--------
[pretty standard_html_header]
Hello! Hello!
This is the index_html document in SF.
--------8<--------

Why is Hello! printed twice???
From SSF, I get Hello! printed 3 times...

Regards, CLAIN Jephte
Service Informatique CHSR.