That's a great summary. Nice work. Geoff
On 26/03/2013, at 12:15 AM, Bård Magnus Kvalheim wrote: > Hi Ken. > > I think what you refer to as the target="" approach is html frames and you > can certainly do that with tapestry or any other framework. > > Here is my understanding of Tapestry 'best practices'. > > *Master layouts* > In tapestry you can create master layouts. A master layout is a page > template that contains header, footer sidebars etc.. and defines a special > region to insert the specific page content. In a tapestry component this is > specified by; <t:body/> > http://tapestry.apache.org/layout-component.html > > > The other typical php/jsp way of doing things is to use includes for > header, footer sidebar - and that works, but consider having 30+ pages than > it's a lot of work to make modifications - like moving sidebar from left to > right hand side. Master templates is the way to go IMO. > > Inside your master template/layout - if you need to display different > content at times you have a few options. > (A layout is 'just' another component and can be as simple/advanced as > you'd like. ) > > *Conditional if's* > use if statements to conditionally show the content. > > *Blocks* > define blocks within layout template and have logic to display/delegate to > what you need. > > *Template inheritance* > Should not be overused, but quite useful feature. > http://tapestry.apache.org/component-templates.html#ComponentTemplates-TemplateInheritance. > Can for example have master templates; > simple no sidebar, > standard with sidebar (which inherit from the simple) > > *Blocks as parameters* > define block parameters to layout component. Say you have a sidebar where > you want to display different content depending on what page you're on then > give it as parameter. (From the page) > http://tapestry.apache.org/component-templates.html#ComponentTemplates-parameternamespaces > > *Reusable components* > If you have pieces of markup and/or logic that is reusable, then it's easy > and useful to make it a component with own tml / java/ + resources files. > Think this is what you refer to as "whole TML file" > > > I use all of these approaches - they are all good but think only you know > when it's appropriate to use one over the others. I would definitely start > with a layout though. > Last time I checked the maven quickstart also included examples for blocks > and master layout/components. > > cheers > Magnus > > On Mon, Mar 25, 2013 at 2:24 AM, Ken in Nashua <kcola...@live.com> wrote: > >> Well it seems there is a concept called blocks... >> >> And this construct has support for active block. >> >> This seems like it is what I am seeking hopefully. >> >> And the delegate component is the guy that operates and manipulates and >> detects? >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org