[PEAK] Templates with layout

Phillip J. Eby pje at telecommunity.com
Mon Jun 6 12:02:58 EDT 2005


At 04:45 PM 6/6/2005 +0200, Radek Kanovsky wrote:
>Lets have some simple PWT template "repr.pwt":
>
>         <html this:is="page">
>             <div content:replace="."/>
>         </html>
>
>It correctly shows repr() of the underlying object. Everything is OK untill
>we try to use some layout:
>
>     repr.pwt:
>
>         <html with:page-layout="@@layout">
>             <div this:is='body' content:replace="."/>
>         </html>
>
>     layout.pwt:
>
>         <html this:is="page">
>             <div this:replace="/params/body"/>
>         </html>
>
>Then we end in infinite recursion, because current object in repr.pwt
>is not underlying object but parsed layout.pwt template. Workaround
>is to use ``content:replace=".."'' in repr.pwt but I am almost sure
>that this is not intended behaviour.

Hi Radek.  I'm unable to reproduce this behavior.  I just checked in a new 
test that does this using the HTML straight from your examples above.  See 
peak.web.tests.test_resources.IntegrationTests.testLayout.  Can you tell me 
more about how to reproduce this behavior?  The system already has code 
that should make layouts work the way you want them to, so I'm surprised 
that you're having a problem.

Could it be that you are not rendering the top-level page via handle_http, 
but instead are using a manually-created start context and renderFor()?




More information about the PEAK mailing list