If the sidebar really changes for each page, then it can be a Block parameter to the layout component. This will allow the layout component to control where, within its templates, the sidebar appears. Check out the t:parameter documentation.
On 4/10/07, Stephane PAQUET <[EMAIL PROTECTED]> wrote:
Just one question, why don't you use a CSS layout + ASSET in stead of component (this does not apply to the sidebar). Rgds, SP On Apr 10, 2007, at 8:28 AM, Yann Ramin wrote: > I'm using T5 to do some experimental testing, creating some mockup > applications to teach me more about the framework. > > My question is, how do you best handle multi-part layouts? > > For instance, a Layout can be composed of a Body and a Sidebar. The > Sidebar can be a component. > > My current approach is to have a > > Page.java: > > public Page { > @Component > private Layout _layout; > @Component > private Sidebar _sidebar; > } > > Page.html: > > <t:layout t:id="layout" blah> > <div id="main"> > fee fi fo fum > </div> > <t:sidebar t:id="sidebar" bar="true"/> > </t:layout> > > This feels suboptimal, as I'm encoding the location of the sidebar > into each and every page (namely always coming after the main div). > I'd like to have the Sidebar component in the Layout component, but > feed this component from the Page to the Layout (as the Sidebar > component could be different on every page). I.e., <t:layout > sidebar="sidebar">, but that is a parameter, not a component, so > afaik won't work like I expect it to (it didn't in testing, but > could have been anything). > > Any way of accomplishing this? Any better solutions to this > problem? Am I missing something? > > > BTW, T5 is a great framework - having lots of fun with it! > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]