That was really helpful. Inserting another tile as the body is a good start. I have just tried it though and I still have the following problem ..
I have MasterLayout.jsp and FormLayout.jsp again. MasterLayout.jsp contains the website generic stuff. E.g. <snip> <tiles:getAsString name="title" /> <tiles:insert attribute="MenuDefinitions" /> <tiles:insert attribute="body" /> </snip> FormLayout.jsp contains the layout of a particular subset of the website. It's really a searching mechanism and although it has some components that are always there, there are various components that are only populated in some places. So the layout looks like this: <html:form> <tiles:insert attribute="AlwaysThereFilter" /> <tiles:insert attribute="SometimeFilter" ignore="true" /> </html:form> So following the advice below I have a base tile and a form tile. <definition name="tile.base" path="/layout/MasterLayout.jsp"> <put name="MenuDefinitions" value="/pageComponents/MenuDefinitions.jsp" /> </definition> and <definition name="tile.form" path="/layout/FormLayout.jsp" > <put name="AlwaysThereFilter" value="/pageComponents/AlwaysThereFilter.jsp" /> </definition> But now I want to user the base tiles for actual pages. I want to be able to insert components into both layouts i.e. <definition name="tile.form1" extends="tile.base" > <put name="title" value="Form 1 Page" /> <put name="body" value="tile.form" /> <put name="SometimeFilter" value="/pageComponents/SometimeFilter.jsp" /> </definition> Hopefully this is clear. The title and body should be inserted into the MasterLayout and the SometimeFilter into the FormLayout. When I try this, it just doesn't display the components inserted ( supposedly ) into the FormLayout. Can anyone help me with this? -----Original Message----- From: Greg Reddin [mailto:[EMAIL PROTECTED] Sent: 23 November 2005 15:04 To: Struts Users Mailing List Subject: Re: Tiles Again - Can anyone help? On Nov 22, 2005, at 5:40 PM, Leahy, Kevin wrote: > Hi > Here's MasterLayout.jsp ( abridged ) > <html:html> > <head> > <title><tiles:getAsString name="title" /></title> > <tiles:insert attribute="MenuDefinitions" /> > </head> > <body> > <tiles:insert attribute="body" /> > <tiles:insert attribute="MenuInitializer" /> > </body> > </html:html> > > Here's FormLayout.jsp ( again very abridged ) > > <html:form action="/EventSearch" method="GET" > onsubmit="eventSearchPreSubmit();return validateEventSearchForm > (this);" > <table > <tr><td><tiles:insert attribute="SecurityFilter" > /></td></tr> <tr><td><tiles:insert attribute="SourceFilter" > /></td></tr> > > <tr><td><tiles:insert attribute="FromAndToDateFilter" /></td></tr> > </table> </html:form> Is FormLayout.jsp a separate layout used *instead of* MasterLayout.jsp or is it to be inserted into the body of MasterLayout.jsp? If FormLayout is a body component then you can just extend the tile.base definition, set FormLayoutl.jsp as the body and add your attributes: <definition name="tile.form1" extends="tile.base" > <put name="body" value="/layout/FormLayout.jsp"/> <put name="SecurityFilter" value="/pageComponents/SecurityFilter.jsp" /> <put name="SourceFilter" value="/pageComponents/ SourceFilter.jsp" /> </definition> Or define the form tile as a completely separate one: <definition name="tile.form1" extends="tile.base"> <put name="body" value="tile.formTemplate"/> </definition> <definition name="tile.formTemplate" path="/layout/FormLayout.jsp"> <put name="SecurityFilter" value="/pageComponents/SecurityFilter.jsp" /> <put name="SourceFilter" value="/pageComponents/ SourceFilter.jsp" /> </definition> If FormLayout.jsp is a replacement for MasterLayout.jsp could it be refactored to work like the above? It seems like it would include a lot of the same elements. A controller is useful for defining attributes at runtime. However, I'd be careful about using it to override values that are specified in your config file. This may make it really confusing to maintain. Greg --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ------ -------------------------------------------------------------------------------- The information contained herein is confidential and is intended solely for the addressee. Access by any other party is unauthorised without the express written permission of the sender. If you are not the intended recipient, please contact the sender either via the company switchboard on +44 (0)20 7623 8000, or via e-mail return. If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. 3167 -------------------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]