You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Takacs <mt...@yahoo.com> on 2002/08/19 12:07:59 UTC
Tiles, overriding extended definitions and Breadcrumbing
Summary: Can a page override a sub-definition?
Im trying to do breadcrumb, whee. I've made a page definition with
over-riddes... works great. Having a subLayout definition SEEMED to
work ok, until I tried to override parts of the sub-definition.
In other words, the "body" definition for "page.arc.help" can override
the "body" definitions in "page.arc" just fine, but I cant seem to
override the "trail" definitions in the subLayout, "page.tile.crumb".
When I do provide an override, it ignores it and used the default
"trail" definition I've used when initially defining "page.tile.crumb".
Grr.
<!-- 'Base' Definition for a page -->
<definition name="page.arc" template="/layouts/baseLayout.jsp">
<put name="body" content="/tiles/common/body.jsp" />
<put name="breadcrumb" content="page.tile.crumb" />
<put name="footer" content="/tiles/common/footer.jsp" />
<put name="header" content="/tiles/common/header.jsp" />
<put name="title" content="/tiles/common/title.jsp"/>
</definition>
<!-- 'Crumb' has a sublayout -->
<definition name="page.tile.crumb" template="/layouts/breadcrumb.jsp">
<put name="trail" content="/tiles/common/crumbTrail.jsp" />
<put name="static" content="/tiles/common/crumbHelp.jsp" />
</definition>
<!-- Individual pages extending the 'Base' Definition -->
<definition name="page.arc.help" extends="page.arc">
<put name="body" content="/tiles/help.jsp"/>
<put name="trail" content="/tiles/crumbs/help.jsp"/>
</definition>
----------
/layouts/breadcrumb.jps: (simplified)
<tiles:insert attribute="trail"/>
<tiles:insert attribute="static"/>
-----
In my defintion for "page.arc.help", the "trail" override isnt being
used, the original one defined in "page.tile.crumb" is always being
used..
If I flatted the hiearchy (include the 2 pieces of the breadcrumb
layout directly in the baseLayout.jsp) it works just fine.
So Im guessing tiles doesnt support overriding child definitions?
-tak
__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Tiles, overriding extended definitions and Breadcrumbing
Posted by Cedric Dumoulin <ce...@apache.org>.
The "override" mechanism only override attributes from the extended
definition. In your example, you insert a tiles and want some of its
attributes be overriden by attributes from its "insertor" which is not
working.
Cedric
Mark Takacs wrote:
>Summary: Can a page override a sub-definition?
>
>
>Im trying to do breadcrumb, whee. I've made a page definition with
>over-riddes... works great. Having a subLayout definition SEEMED to
>work ok, until I tried to override parts of the sub-definition.
>
>In other words, the "body" definition for "page.arc.help" can override
>the "body" definitions in "page.arc" just fine, but I cant seem to
>override the "trail" definitions in the subLayout, "page.tile.crumb".
>When I do provide an override, it ignores it and used the default
>"trail" definition I've used when initially defining "page.tile.crumb".
> Grr.
>
>
><!-- 'Base' Definition for a page -->
><definition name="page.arc" template="/layouts/baseLayout.jsp">
> <put name="body" content="/tiles/common/body.jsp" />
> <put name="breadcrumb" content="page.tile.crumb" />
> <put name="footer" content="/tiles/common/footer.jsp" />
> <put name="header" content="/tiles/common/header.jsp" />
> <put name="title" content="/tiles/common/title.jsp"/>
></definition>
>
><!-- 'Crumb' has a sublayout -->
><definition name="page.tile.crumb" template="/layouts/breadcrumb.jsp">
> <put name="trail" content="/tiles/common/crumbTrail.jsp" />
> <put name="static" content="/tiles/common/crumbHelp.jsp" />
></definition>
>
><!-- Individual pages extending the 'Base' Definition -->
><definition name="page.arc.help" extends="page.arc">
> <put name="body" content="/tiles/help.jsp"/>
> <put name="trail" content="/tiles/crumbs/help.jsp"/>
></definition>
>
>
>----------
>/layouts/breadcrumb.jps: (simplified)
>
><tiles:insert attribute="trail"/>
><tiles:insert attribute="static"/>
>
>-----
>
>In my defintion for "page.arc.help", the "trail" override isnt being
>used, the original one defined in "page.tile.crumb" is always being
>used..
>
>If I flatted the hiearchy (include the 2 pieces of the breadcrumb
>layout directly in the baseLayout.jsp) it works just fine.
>
>So Im guessing tiles doesnt support overriding child definitions?
>
>-tak
>
>
>
>__________________________________________________
>Do You Yahoo!?
>HotJobs - Search Thousands of New Jobs
>http://www.hotjobs.com
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Tiles, overriding extended definitions and Breadcrumbing
Posted by James Mitchell <jm...@telocity.com>.
> So Im guessing tiles doesnt support overriding child definitions?
Yes, you are correct.
If you are trying to use "trail" in "page.arc" to over-ride "trail" in
"page.tile.crumb", that's not going to work.....but then....you already know
that :)
James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta
> -----Original Message-----
> From: Mark Takacs [mailto:mtakacs@yahoo.com]
> Sent: Monday, August 19, 2002 6:08 AM
> To: struts-user@jakarta.apache.org
> Subject: Tiles, overriding extended definitions and Breadcrumbing
>
>
> Summary: Can a page override a sub-definition?
>
>
> Im trying to do breadcrumb, whee. I've made a page definition with
> over-riddes... works great. Having a subLayout definition SEEMED to
> work ok, until I tried to override parts of the sub-definition.
>
> In other words, the "body" definition for "page.arc.help" can override
> the "body" definitions in "page.arc" just fine, but I cant seem to
> override the "trail" definitions in the subLayout, "page.tile.crumb".
> When I do provide an override, it ignores it and used the default
> "trail" definition I've used when initially defining "page.tile.crumb".
> Grr.
>
>
> <!-- 'Base' Definition for a page -->
> <definition name="page.arc" template="/layouts/baseLayout.jsp">
> <put name="body" content="/tiles/common/body.jsp" />
> <put name="breadcrumb" content="page.tile.crumb" />
> <put name="footer" content="/tiles/common/footer.jsp" />
> <put name="header" content="/tiles/common/header.jsp" />
> <put name="title" content="/tiles/common/title.jsp"/>
> </definition>
>
> <!-- 'Crumb' has a sublayout -->
> <definition name="page.tile.crumb" template="/layouts/breadcrumb.jsp">
> <put name="trail" content="/tiles/common/crumbTrail.jsp" />
> <put name="static" content="/tiles/common/crumbHelp.jsp" />
> </definition>
>
> <!-- Individual pages extending the 'Base' Definition -->
> <definition name="page.arc.help" extends="page.arc">
> <put name="body" content="/tiles/help.jsp"/>
> <put name="trail" content="/tiles/crumbs/help.jsp"/>
> </definition>
>
>
> ----------
> /layouts/breadcrumb.jps: (simplified)
>
> <tiles:insert attribute="trail"/>
> <tiles:insert attribute="static"/>
>
> -----
>
> In my defintion for "page.arc.help", the "trail" override isnt being
> used, the original one defined in "page.tile.crumb" is always being
> used..
>
> If I flatted the hiearchy (include the 2 pieces of the breadcrumb
> layout directly in the baseLayout.jsp) it works just fine.
>
> So Im guessing tiles doesnt support overriding child definitions?
>
> -tak
>
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>