You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Irv Salisbury <ir...@gmail.com> on 2006/09/17 20:51:27 UTC

Best way for common page areas

If we have pages that have common headers, footers, etc, what is the best
way to do that with Tapestry?  We have used XSL in the past for such
"templating" needs.  What is the best way to accomplish this?

Thanks,

Irv

Re: Best way for common page areas

Posted by Irv Salisbury <ir...@gmail.com>.
Thanks a lot!  This will help.

Irv

On 9/17/06, Bernard <be...@man.poznan.pl> wrote:
>
> Irv Salisbury wrote:
> > If we have pages that have common headers, footers, etc, what is the
> best
> > way to do that with Tapestry?
>
> Split your common layout into smaller parts and create components ie.
> Footer, Header, TopMenu, LeftMenu etc. and reuse them.
>
> If your pages share common layout it is good to create a common border
> component/s. These acts as decorators to their content. You use such a
> component to wrap page's actual content.
>
> Ie. sample @Border component:
> <span jwcid="@Shell">
>    <span jwcid="@Header"/>
>    <span jwcid="@LeftMenu"/>
>    <span jwcid="@RenderBody"/> <!-- this is where your wrapped content
> will be rendered -->
>    <span jwcid="@Footer" />
> </span>
>
> Sample page:
> <span jwcid="@Border">
>    <span jwcid="@Body"> <-- a body component can be also a part of the
> border, if you like -->
>      page content goes here
>    </span>
> </span>
>
>
>
> Best regards,
> Bernard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Best way for common page areas

Posted by Bernard <be...@man.poznan.pl>.
Irv Salisbury wrote:
> If we have pages that have common headers, footers, etc, what is the best
> way to do that with Tapestry?  

Split your common layout into smaller parts and create components ie. 
Footer, Header, TopMenu, LeftMenu etc. and reuse them.

If your pages share common layout it is good to create a common border 
component/s. These acts as decorators to their content. You use such a 
component to wrap page's actual content.

Ie. sample @Border component:
<span jwcid="@Shell">
   <span jwcid="@Header"/>
   <span jwcid="@LeftMenu"/>
   <span jwcid="@RenderBody"/> <!-- this is where your wrapped content 
will be rendered -->
   <span jwcid="@Footer" />
</span>

Sample page:
<span jwcid="@Border">
   <span jwcid="@Body"> <-- a body component can be also a part of the 
border, if you like -->
     page content goes here
   </span>
</span>



Best regards,
Bernard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org