Of course you are not at all limited to only one of these "layout" components. While you can only request one per page or component, the "layout" you request could itself use another layout. For lack of a better term, these used to be called Borders in Tapestry 4.
You can also have these borders on Components, not just pages. This can be useful for wrapping a component in a box, for example. Borders are really simple to make, as you've seen from Marcelo. Now lets say you end up having lots of borders/layout components. If you want to put them into a directory under components/, you'll access them using a "." between the directory name and the border component name. i.e. for components/layouts/border1.html you would use: <t:layouts.border1 xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> On 8/22/07, Marcelo lotif <[EMAIL PROTECTED]> wrote: > If this help, try to follow my example above: > > create a class under src/main/java/org/example/myapp/components called > Layout.java, for example. Now we put a css stylesheet and a title, just to > illustrate: > > public class Layout { > > @Inject > @Path("context:assets/css/layout.css") > private Asset layoutCSS; > > private String title = "Some Title"; > > public Asset getLayoutCSS() { > return layoutCSS; > } > > public String getTitle() { > return title; > } > > } > > now, create a template under src/main/resources/org/example/myapp/components > with the same name (i.e. Layout.html): > > <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> > <head> > <title>&{title}</title> > <link href="${layoutCSS}" rel="stylesheet" type="text/css"/> > </head> > <body> > <table width="100%" height="100%" border="0"> > <tr> > <td valign="top" height="100%"> > <t:body>Page content goes here.</t:body> > </td> > </tr> > </table> > </body> > </html> > > let the Start.html use this template as it's base adding this lines to it: > > <t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> > <!-- put the rest of the page here --> > </t:layout> > > and you're done! > very simple! :) > > 2007/8/22, Anton Gavazuk <[EMAIL PROTECTED]>: > > > > Hi Angelo, > > I had the same question and as I understood - you have to write your own > > custom component > > see > > http://tapestry.apache.org/tapestry5/tapestry-core/guide/templates.html > > and now I try to implement this - if you are interested - we can > > communicate > > about the topic and create some kind of howto... > > > > 2007/8/22, Angelo Chen <[EMAIL PROTECTED] >: > > > > > > > > > Hi, > > > > > > Is there a way to do something like Struts with Tiles in Tapestry 5? > > > samples? Thanks. > > > > > > A.C. > > > -- > > > View this message in context: > > > http://www.nabble.com/T5%3ATiles--tf4310807.html#a12272065 > > > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > -- > Atenciosamente, > Marcelo Lotif > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]