You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alfonso Quiroga <al...@gmail.com> on 2010/03/23 03:29:00 UTC

"dynamic" tml

Hi! I just want to know something.. I used layouts in T5 (
http://wiki.apache.org/tapestry/Tapestry5SimpleAndPowerfulLayouts) and it
works OK. My layout-tml has 3 o 4 IF and renders fine.

But what happens if I want really dynamic layout-tml? I mean, if a page uses
layout "peter", it should search a peter.tml, and if a page uses layout
"pretty", pretty.tml.
Is this possible? It would be a great feature for a lot of sites (every user
could change the site layout when he logs in). And really simple, every new
layout is just a new tml file.

Thanks

Re: "dynamic" tml

Posted by Igor Drobiazko <ig...@gmail.com>.
Nope, <t:delegate/> is used to delegate rendering to an object (e.g. Block)
located in the same page/template. You can only provide locale-specific
templates of your component: Foo.tml, Foo_en.tml, Foo_ru.tml.

On Tue, Mar 23, 2010 at 4:46 AM, Alfonso Quiroga <al...@gmail.com>wrote:

> You mean <t:delegate> "might" choose between different .tml files in the
> webapp dir?
>
> On Tue, Mar 23, 2010 at 12:04 AM, Angelo Chen <angelochen960@yahoo.com.hk
> >wrote:
>
> >
> > delegate might work. also Velocity with outraw component can somehow
> > achieve
> > that.
> >
> >
> > Alfonso Quiroga wrote:
> > >
> > > Hi! I just want to know something.. I used layouts in T5 (
> > > http://wiki.apache.org/tapestry/Tapestry5SimpleAndPowerfulLayouts) and
> > it
> > > works OK. My layout-tml has 3 o 4 IF and renders fine.
> > >
> > > But what happens if I want really dynamic layout-tml? I mean, if a page
> > > uses
> > > layout "peter", it should search a peter.tml, and if a page uses layout
> > > "pretty", pretty.tml.
> > > Is this possible? It would be a great feature for a lot of sites (every
> > > user
> > > could change the site layout when he logs in). And really simple, every
> > > new
> > > layout is just a new tml file.
> > >
> > > Thanks
> > >
> > >
> >
> > --
> > View this message in context:
> > http://old.nabble.com/%22dynamic%22-tml-tp27995671p27995861.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>



-- 
Best regards,

Igor Drobiazko
http://tapestry5.de/blog

Re: "dynamic" tml

Posted by Alfonso Quiroga <al...@gmail.com>.
You mean <t:delegate> "might" choose between different .tml files in the
webapp dir?

On Tue, Mar 23, 2010 at 12:04 AM, Angelo Chen <an...@yahoo.com.hk>wrote:

>
> delegate might work. also Velocity with outraw component can somehow
> achieve
> that.
>
>
> Alfonso Quiroga wrote:
> >
> > Hi! I just want to know something.. I used layouts in T5 (
> > http://wiki.apache.org/tapestry/Tapestry5SimpleAndPowerfulLayouts) and
> it
> > works OK. My layout-tml has 3 o 4 IF and renders fine.
> >
> > But what happens if I want really dynamic layout-tml? I mean, if a page
> > uses
> > layout "peter", it should search a peter.tml, and if a page uses layout
> > "pretty", pretty.tml.
> > Is this possible? It would be a great feature for a lot of sites (every
> > user
> > could change the site layout when he logs in). And really simple, every
> > new
> > layout is just a new tml file.
> >
> > Thanks
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/%22dynamic%22-tml-tp27995671p27995861.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: "dynamic" tml

Posted by Angelo Chen <an...@yahoo.com.hk>.
delegate might work. also Velocity with outraw component can somehow achieve
that.


Alfonso Quiroga wrote:
> 
> Hi! I just want to know something.. I used layouts in T5 (
> http://wiki.apache.org/tapestry/Tapestry5SimpleAndPowerfulLayouts) and it
> works OK. My layout-tml has 3 o 4 IF and renders fine.
> 
> But what happens if I want really dynamic layout-tml? I mean, if a page
> uses
> layout "peter", it should search a peter.tml, and if a page uses layout
> "pretty", pretty.tml.
> Is this possible? It would be a great feature for a lot of sites (every
> user
> could change the site layout when he logs in). And really simple, every
> new
> layout is just a new tml file.
> 
> Thanks
> 
> 

-- 
View this message in context: http://old.nabble.com/%22dynamic%22-tml-tp27995671p27995861.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: "dynamic" tml

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 22 Mar 2010 23:29:00 -0300, Alfonso Quiroga  
<al...@gmail.com> wrote:

> But what happens if I want really dynamic layout-tml? I mean, if a page  
> uses layout "peter", it should search a peter.tml, and if a page uses  
> layout
> "pretty", pretty.tml.

You can use blocks and the ComponentSource component for that, but I  
suggest you to rethink what you want.

> Is this possible? It would be a great feature for a lot of sites

It is possible to load templates from other places, but you need to  
override or decorate some Tapestry services.

> (every user could change the site layout when he logs in).

You can use CSS for that. See csszengarden.com for examples of radically  
different layouts using the same HTML and different CSS and image files.
Tapestry templates are meant to be used by developers, not users. If I  
needed to provide some templating for users, I would use some template  
engine like Velocity of Freemarker (preferred).

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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