You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jan Vissers <Ja...@cumquat.nl> on 2008/04/16 17:11:35 UTC

Templating/Layout question

Hi,

Consider this Layout component:

    <body>
        <div id="container">
            <t:branding t:id="branding" />
            <t:heading t:id="heading" />
            <t:body />
            <t:copyright t:id="copyright" />
        </div>
    </body>

Suppose my 'body' can contain one or more 'Panel's. I want this Panel to
have some standard UI assets and functionality, but most of it is 'free
format'. Basically the 'free format' bit holds the actual use case
representation. How would I do this? Should I create a base Panel Page (or
component) and subclass for concrete panels? Basically in 'body' there
could be more than one concrete t:bodies. If somebody still understands
what I'm aiming for - please feel free to chime in ;-)

-J.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Templating/Layout question

Posted by Peter Beshai <pe...@gmail.com>.
I don't fully understand what you're looking for, but maybe this will help:

Use parameters with the layout component. This has the same effect as
'multiple t:body' elements. For example,

Layout:
...
   <body>
       <div id="container">
           <t:branding t:id="branding" />
           <t:heading t:id="heading" />

           <div id="primaryPanel">
               <t:delegate to="primaryPanelBlock"/>
           </div>

           <div id="secondaryPanel">
               <t:delegate to="secondaryPanelBlock"/>
           </div>

           <t:copyright t:id="copyright" />
       </div>
   </body>
...

Then your pages would do something like:

<t:layout ...>
  <t:parameter name="primaryPanelBlock">
    This goes in the div with id 'primaryPanel'
  </t:parameter>

  <t:parameter name="secondaryPanelBlock">
    This goes in the div with id 'secondaryPanel'
  </t:parameter>
</t:layout>


You may want to use a specific component 'PanelLayout' for this and leave
the regular layout for non-paneled pages.


Peter Beshai

On Wed, Apr 16, 2008 at 11:11 AM, Jan Vissers <Ja...@cumquat.nl>
wrote:

> Hi,
>
> Consider this Layout component:
>
>    <body>
>        <div id="container">
>            <t:branding t:id="branding" />
>            <t:heading t:id="heading" />
>            <t:body />
>            <t:copyright t:id="copyright" />
>        </div>
>    </body>
>
> Suppose my 'body' can contain one or more 'Panel's. I want this Panel to
> have some standard UI assets and functionality, but most of it is 'free
> format'. Basically the 'free format' bit holds the actual use case
> representation. How would I do this? Should I create a base Panel Page (or
> component) and subclass for concrete panels? Basically in 'body' there
> could be more than one concrete t:bodies. If somebody still understands
> what I'm aiming for - please feel free to chime in ;-)
>
> -J.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>