Re: delegage or target

2013-03-26 Thread Barry Books
I would also check out Dynamic.

http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Dynamic.html

It's easy enough to fetch its template from a database of other source
outside the project to provide per user/company etc customization of a
layout.

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



Re: delegage or target

2013-03-26 Thread Geoff Callender
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; 
> 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  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



Re: delegage or target

2013-03-25 Thread Bård Magnus Kvalheim
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; 
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  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?
>
>


Re: delegage or target

2013-03-25 Thread Thiago H de Paula Figueiredo
On Sun, 24 Mar 2013 23:09:50 -0300, Ken in Nashua   
wrote:


Ok... for instance I want to just pull up a tml file and start editing  
the heck out of it...


You can't do that, at least not easily.


say footer.tml

and inside my layout...



Is this legal ? or reasonable practice ?


No. No. Just declare blocks and use the Delegate component to render them.

--
Thiago H. de Paula Figueiredo

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



RE: delegage or target

2013-03-24 Thread Ken in Nashua
Ok... for instance I want to just pull up a tml file and start editing the heck 
out of it...

say footer.tml

and inside my layout...



Is this legal ? or reasonable practice ? 
I am trying not to worry about the in betweens (or at least minimize and 
simplify them)... I just want to edit my files and honk them all the layout 
modularly.

  

RE: delegage or target

2013-03-24 Thread Ken in Nashua
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?