Hi Greg

Really what I'm after now I'm looking at it more carefully is a way of
composing layouts from other layouts where the layouts themselves have some
flexibility in terms of the components that are inserted into them. This
seems such a basic requirement that I wonder if I'm missing something
obvious. 

Has no-one else wanted this facility? I would have thought you would be able
to nest the put tags where the outer put is a tile...

Example.

OuterLayout.jsp

<html>
<head>
</head>
<body>
        <tiles:insert attribute="Menu" />
        <tiles:insert attribute="Title" />
        <tiles:insert attribute="Content" />    
</body>
</html>

InnerLayout.jsp

<tiles:insert attribute="Mandatory" />
<tiles:insert attribute="Optional1" />
<tiles:insert attribute="Optional2" />


<definition name="tile.outer" path="/layout/OuterLayout.jsp">
        <put name="Title" value="/pageComponents/GenericTitle.jsp" />
        <put name="Menu" value="/pageComponents/Menu.jsp" />
</definition>

<definition name="tile.inner" path="/layout/InnerLayout.jsp">
        <put name="Mandatory" value="/pageComponents/Mandatory.jsp" />
</definition> 

<definition name="tile.page1" extends="tile.outer" >
        <!-- insert into OuterLayout -->
        <put name="Title" value="/pageComponents/GenericTitle.jsp" />
        <put name="Content" value="tile.inner" >
                <put name="Optional1" value="/pageComponents/Optional1.jsp"
/>
                <put name="Optional2" value="/pageComponents/Optional2.jsp"
/>
        </put>
</definition> 

However the put tag doesn't take nested elements. I tried already. I'm sure
there must be way to do this though. Is there a way to make layouts extend
other layouts. I.e. in the example above could I specify a third layout that
combined the inner and outer into a third one somehow? 


-----Original Message-----
From: Greg Reddin [mailto:[EMAIL PROTECTED] 
Sent: 23 November 2005 18:37
To: Struts Users Mailing List
Subject: Re: Tiles Again - Can anyone help?


On Nov 23, 2005, at 12:09 PM, Leahy, Kevin wrote:

>     <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>
>
> When I try this, it just doesn't display the components inserted ( 
> supposedly ) into the FormLayout.

I think your SometimeFilter would need to be in "tile.form" instead of
"tile.form1"

Unfortunately, the only way I can think of to do that in definitions is
this:

<definition name="tile.form" path="/layout/FormLayout.jsp" >
     <put name="AlwaysThereFilter"
         value="/pageComponents/AlwaysThereFilter.jsp" />
  </definition>

<definition name="tile.form.withSomeFilter" extends="tile.form">
     <put name="SometimeFilter"
         value="/pageComponents/SometimeFilter.jsp" /> </definition>

  <definition name="tile.form1" extends="tile.base" >
      <put name="title" value="Form 1 Page" />
      <put name="body" value="tile. form.withSomeFilter" /> </definition>

I guess that's fine if you only have a couple different templates.   
But your config file will get pretty cluttered if you have a lot.

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]

Reply via email to