Bob,

The documentation is correct, but requires some getting used to.

A layout component is more of a design pattern (like the Border in T4).  It
is designed to be wrapped around something.  That something appears where
you see <t:body />

The naming is by convention.  I'm still using a T4 convention, so I actually
use a <t:border /> rather than a <t:layout />, because I created a component
named Border rather than one named Layout.  You could call it anything you
want!

When you use <t:layout />, in your page, it's like saying, "Take everything
inside of this tag and put in into Layout where you see <t:body />".

I hope that helps.

Jonathan


> -----Original Message-----
> From: Heck, Bob [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 18, 2007 11:37 AM
> To: Tapestry users
> Subject: Templates and t:body
> 
> I am really confused and in need of some clarification.
> 
> The templates documentation for Tapestry 5
> (http://tapestry.formos.com/nightly/tapestry5/tapestry-core/guide/templa
> tes.html) shows this (direct copy/paste):
> 
> ============================
> The following example is a Layout component, that adds basic HTML
> elements around the page specific content:
> 
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>     <head>
>         <title>My Tapestry Application</title>
>     </head>
>     <body>
>         <t:body/>
>     </body>
> </html>
> 
> A page would use this component as follow:
> 
> <t:layout
> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
> 
>   My Page Specific Content
> 
> </t:layout>
> 
> When the page renders, the page's template and the Border component's
> template are merged together:
> 
> <html>
>   <head>
>     <title>My Tapestry Application</title>
>   </head>
>   <body>
>     My Page Specific Content
>   </body>
> </html>
> ==============================
> 
> 
> 1.  I thought a layout component should start with t:layout, someone
> please clarify if the first block is actually a layout component.
> 
> 2.  I will assume (not sure this is correct, though) that the
> introductory sentences are reversed and the layout component is actually
> the second block, i.e.:
> 
> <t:layout
> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
> 
>   My Page Specific Content
> 
> </t:layout>
> 
> 
> And, the page is actually the first block, i.e.:
> 
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>     <head>
>         <title>My Tapestry Application</title>
>     </head>
>     <body>
>         <t:body/>
>     </body>
> </html>
> 
> 
> 3.  Given that #2 assumption is correct, I still do not understand how
> the page inserts the layout template in the body.  There is no id given
> to the template, so where is the linking between the two? Is there a
> specific name given to the template file?  If so, it is not explained or
> even mentioned.
> 
> 4.  The sentence "When the page renders, the page's template and the
> Border component's template are merged together:" is confusing as well,
> as I read elsewhere that there is no Border component in T5.
> 
> 
> Am I missing something very basic here?  I just can't seem to get a
> handle.  All I want to do is include menus/navigation in other pages,
> does not seem like it should be that hard.
> 
> Thanks in advance for your help.
> 
> Bob
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to