Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor wordsmithing and tweaked the layout example

...

Tapestry elements are elements defined using the Tapestry namespace prefix (usually "t:").

All other elements should be in the default namespace, with no prefix.

There are a certain number of Tapestry elements, listed below, that act as template directives; beyond that, any element in the Tapestry namespace will be a Tapestry component.

...

In many cases, a component is designed to integrate have its template with its container's templateintegrate with, or "wrap around", the containing component.

The <t:body> element is used to identify where, within a component's template, its body (from the container's template) is to be rendered.

...

The following example is a Layout component, that adds basic HTML elements around the page-specific content:

Code Block
xml
xml
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
    <head>
        <title>My Tapestry Application</title>
    </head>
    <body>
        <t:body/>
    </body>
</html>

That "<t:body/>" element marks where the containing page's content will be inserted. A page would then use this component as follow:

Code Block
xml
xml
<t:layout<html t:type="layout" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">

  My Page Specific Content

</t:layout>
Info
In this example, t:layout creates a Layout component (more on this shortly).
html>

When the page renders, the page's template and the Layout component's template are merged together:

...