On Mon, Aug 29, 2011 at 1:38 PM, Rick R <[email protected]> wrote:

>
>
> On Mon, Aug 29, 2011 at 1:35 PM, Antonio Petrelli <
> [email protected]> wrote:
>
>>
>> >
>> > Oh, I see something like this maybe (which works, although definitely
>> more
>> > verbose):
>> >
>> > <definition name="signup" extends="base.definition">
>> >  <put-attribute name="pageBody">
>> > <definition templateExpression="/WEB-INF/layouts/plainBody.jsp">
>> >  <put-attribute name="content"
>> value="/WEB-INF/views/signup/signup.jsp"/>
>> > </definition>
>> >  </put-attribute>
>> > </definition>
>> >
>>
>> It's not verbose, it's right.
>>
>>
>
>
> Ok so should that be preferred over using 'cascade=true' (which I'm
> thinking your suggesting it is.)
>
> I got that above down to a little more clear with the following (used
> extends on pageBody to plain.body so that template definition could be
> defined in a more common place.)
>
> <definition name="signup" extends="base.definition">
> <put-attribute name="pageBody">
>  <definition extends="plain.body">
> <put-attribute name="content" value="/WEB-INF/views/signup/signup.jsp"/>
>  </definition>
> </put-attribute>
> </definition>
>
>

It is more verbose though but I prefer to do what is 'right' and won't get
me into trouble later. But here are the two side by side:

BEFORE using cascade, most page definitions using the plain layout would
look like:

<definition name="signup" extends="plainLayout">
<put-attribute name="content" value="/WEB-INF/views/signup/signup.jsp"
cascade="true"/>
</definition>


NOT using cascade and the nested definition:

<definition name="signup" extends="base.definition">
 <put-attribute name="pageBody">
<definition extends="plain.body">
 <put-attribute name="content" value="/WEB-INF/views/signup/signup.jsp"/>
</definition>
 </put-attribute>
</definition>

Reply via email to