velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Tiles put scope?
Date Mon, 12 Jan 2004 07:34:03 GMT

I am beginning to convert a site to using Tiles, and I seem to be having a little problem
understanding scope of variables defined within a Tile.

Basically I have a set of Tiles definitions (defined below) and Master Template defined towards
the bottom.   The default template works except that my web page is created minus two minor
problems.   The topScript (aka javascript) and topTitle seem to not being included within
the sub-template defaultTop.vm.

How can a sub-template see the definitions.   I figured that since the variable was defined
in defaultTemplate that defaultTop would be able to see it.  If not, then how can I pull out
aspects of code like those pieces and not break with Tiles requirements.

I hope this makes sense.


Tiles Defs follow:

    <definition name="defaultTemplate" path="/WEB-INF/templates/pub/common/tiles/defaultTemplate.vm">
        <put name="topTitle" value="Site Services" />
        <put name="topScript" value="" />
        <put name="top" value="/WEB-INF/templates/pub/common/tiles/defaultTop.vm" />
        <put name="header" value="/WEB-INF/templates/pub/common/tiles/defaultHeader.vm"
        <put name="body" value="/WEB-INF/templates/pub/common/tiles/defaultBody.vm" />
        <put name="footer" value="/WEB-INF/templates/pub/common/tiles/defaultFooter.vm"

    <definition name="tile.welcome" extends="defaultTemplate">
        <put name="body" value="/WEB-INF/templates/pub/home/welcome.vm" />

    <definition name="" extends="defaultTemplate">
        <put name="body" value="/WEB-INF/templates/pub/services/post/search/postsearch.vm"
        <put name="topScript" value="/WEB-INF/templates/pub/common/tiles/defaultFormJavascript.vm"

    <definition name="" extends="defaultTemplate">
        <put name="body" value="/WEB-INF/templates/pub/services/post/search/postsearchresults.vm"

I had defined a simple master template as follows:

<tr><td valign="top" align="left">
<tr><td valign="top"  align="left">
<tr><td valign="top" align="left">

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message