On Thu, 2 Sep 2004 06:43:25 -0700 (PDT), Caroline Jen <[EMAIL PROTECTED]> wrote: > How do I display tiles in columns in the browser? > > I have been using tiles feature of the Struts > framework, and the tiles are displayed in the browser > in "rows". This is my setup (which works fine): > > <tiles:get name="banner"/> > <tiles:get name="upperbar"/> > <tiles:get name="content"/> > <tiles:get name="lowerbar"/> > > Now, the third row has two columns; the column on the > left is a pane with a number of links. All my web > pages will show this column. The column on the right > is the content, which varies page by page. > > How do I modify my setup for the third row to have two > columns? > > _______________________________ > Do you Yahoo!? > Win 1 of 4,000 free domain names from Yahoo! Enter now. > http://promotions.yahoo.com/goldrush > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > I think that You are missing something.
First create one jsp page (baseLayout.jsp) you can call it whatever You like <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %> <table> <tr> <td> <tiles:insert attribute="col1"></tiles:insert> </td> <td> <tiles:insert attribute="col2"></tiles:insert> </td> <td> <tiles:insert attribute="col3"></tiles:insert> </td> </tr> </table> Than in Your Tiles definitions (tiles-def.xml) file define your baseLayout like this. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd"> <tiles-definitions> <definition name="baseLayout" page="/WEB-INF/layouts/baseLayout.jsp"> <put name="col1" value="/firstColumn.jsp" /> <put name="col2" value="/secondColumn.jsp" /> <put name="col3" value="/thirdColumn.jsp" /> </definition> </tiles-definitions> Than create other pages and make them use your base layout. <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%> <tiles:insert page="/WEB-INF/layouts/baseLayout.jsp"> <tiles:put name="col1" value="/leftMenu.jsp"> </tiles:put> <tiles:put name="col2" value="/body.jsp"> </tiles:put> <tiles:put name="col3" value="/bannerBar.jsp"> </tiles:put> </tiles:insert> Please do not try to put this code to work before you read the docs carefully. It will cost you mutch more time and again you will be nowhere. I wrote it just to make you shure that tiles will display wherever You want them (baseLayout.jsp). --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]