I'm still stumped even working with extending definitions on how to
accomplish this. A friend in #struts_users was helping as well and his
solution is good, but still seems like a lot of work. I posted the idea
below this post...

On Wed, 2003-09-03 at 17:31, Rick Reumann wrote:
> Pardon if this is a real stupid question and has been covered before (I
> have looked at some of the docs and didn't see this addressed but I've
> been known to easily miss the obvious:). 
> 
> Imagine you have a site that has a main layout:
> 
> 
> COMPANY LOGO   DATE
> MAIN MENU
> 
> {II. main content section}
> 
> FOOTER
> 
> 
> I could easily set up a layout definition for the above (BaseDef).
> However the problem is each of my sub-sections(II. above) in the
> application could also possibly have different layouts.
> 
> For example, imagine the user goes to the "Accounting" section and 
> the layout of the accounting section has...
> 
> ACCOUNTING HEADER
> LEFT MENU   {accounting page content}   RIGHT STATIC INFO COLUMN
> 
> 
> but maybe the Customer Service section is slightly different...
> 
> CUSTOMER SERVICE HEADER
> {customer service page content}  RIGHT MENU
> 
<snip>

Ok one idea that I got help with would work a bit like this:

<tiles-definitions>
 
  <definition name="BaseDef" path="/BaseDef.jsp">
   <put name="header" value="/header.jsp"/>
   <put name="content" value="${content}"/>
   <put name="footer" value="/footer.jsp"/>
  </definition>

  <definition name="AccountSubSection" path="/AccountSubSection.jsp">
   <put name="menu" value="/menu.jsp"/>
   <put name="accountContent" value="/someAccountPage.jsp"/>
  </definition>

  <definition name="fooBarPageAccount" extends="BaseDef">
   <put name="content" value="AccountSubSection"/>
  </definition>


</tiles-definitions>

The above works ok but it requires two definitions for evey page you
want to go even though the "AccountSubSection" definition is basically
the same with just different accountContent.

I've even tried adding "accountContent" as...

  <definition name="AccountSubSection" path="/AccountSubSection.jsp">
   <put name="menu" value="/menu.jsp"/>
   <put name="accountContent" value="${accountContent}"/>
  </definition>

  <definition name="fooBarPageAccount" extends="BaseDef">
   <put name="content" value="AccountSubSection"/>
   <put name="accountContent" value="/someAccountPage.jsp"/>
  </definition>

but that didn't work. There should be a way this could work without
having to provide two defintions for every page I'd want to go to?

-- 
Rick


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to