Ki,

I think you're kind of missing it. It's sort of inverted relative to, say,
Tiles. Frankly, Tapestry's more natural :-)

You create your individual pages "UserHome.html", "Preferences.html", etc.

You also create a "border" or "layout" component that can wrap it's body. In
the way that a div tag "wraps" its contents, you can create a component that
wraps its contents. Thus, any headrs or footers or navigation would be
created once, in this "border" component. The border component needs to only
tell the system where to insert any content that it wraps.   "<t:body/>"
(inside of your border component) tells the system to take whatever is
inside this component on the page it's being used on and insert it here.

Thus, as mentioned before:

Assume youve got a order component with a navigation bar at the top, a
<t:body/> tag in the middle, and a legal notice on the bottom. Writing:

<t:SiteDesignTemplate>
content unique to UserHome.html goes here
</t:SiteDesignTemplate>

would yeild

1. navigation bar
2  "content unique to UserHome.html goes here"
3. legal notice

You need only change your border component once and everything will update
accordingly.

Thanks,

Josh Long
Sun Certified Java Programmer
http://www.joshlong.com

On 4/20/07, Ki Alam <[EMAIL PROTECTED]> wrote:

Thanks Howard, I really appreciate taking the time to answer my beginner
question.

I have a followup question that maybe you could answer for me:

If I use the layout mechanism you've described, and I have 10 Pages (Start
-> UserHome -> Preferences -> ad naseum), will I be forced to have an HTML
file for each of those pages that loads a different ComponentTemplate?  Or
can I associate one HTML with different Components based on the Start.java/
UserHome.java class?  I'm worried that if I want to make a change to my
site
design, I'll then have to make the changes to 10 HTML files.   I feel like
I
must be missing something, so if you could point me in the right
direction,
that'd be great!

Ki


On 4/18/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
>
> It's a class of component we call a "layout" or a "border".  I.e.
>
> <t:layout>
> My page specific content
> </t:layout>
>
>
> An the Layout component's template:
>
> <html>
> <head>
>   ...
>
>   <t:body/>  <!-- The page specific content -->
>
> ...
> </body>
> </html>
> On 4/18/07, Ki Alam <[EMAIL PROTECTED]> wrote:
> >
> > I'm beginning to work with Tapestry 5 and I'd ideally like to have one
> > page
> > design (created by Dreamweaver) shared between all my pages.  Let's
call
> > that SiteDesignTemplate.html.  This would have <div>s or eve
<td>s  into
> > which I'd like to insert my Start.html and other Tapestry pages as
> > required
> > for each step in my application.  I've looked at the component code in
> the
> > tapestry 5.0.3 source, but I'm having trouble determining the control
> > flow.
> >
> > Are there any examples of this available for tapestry 5?
> >
> > Thanks,
> > Ki
> >
>
>
>
> --
> Howard M. Lewis Ship
> TWD Consulting, Inc.
> Independent J2EE / Open-Source Java Consultant
> Creator and PMC Chair, Apache Tapestry
> Creator, Apache HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>




--
Joshua Long
Sun Certified Java Programmer
http://www.joshlong.com/

Reply via email to